Create or update a site
Creates the site with this domain in the organisation (201), or updates it (200). Sending the same body again leaves the same state and answers 200.
- A site is created in your organisation even if another organisation registered the same domain.
nameabsent keeps the current name;""clears it.default_fragment_refabsent keeps the current default. To set a default on a new site, create the site, then its fragments, then call this again (orPUT …/default-fragment).- A site created through this API has no icon (
favicon_url: null) until it is first opened in the console. - The domain cannot be changed. There is no DELETE: deleting a site is a console action.
Authorizations
A management token: ds_mgmt_ followed by 40 lowercase hexadecimal characters, created by an owner in Settings → Management tokens. Opaque: send it as is, in the Authorization header only.
Path Parameters
The site's bare domain, normalized like the console form (trimmed, lowercase). www.news-site.example and news-site.example are two different sites. A domain that is not a site of this organisation — absent, another organisation's, or not a valid domain — is 404, except on PUT /v1/sites/{domain}, which creates the site and answers 422 for an invalid domain.
Body
Send Content-Type: application/json and a JSON object of at most 262,144 bytes.
Both fields are optional; {} creates the site without a name, or changes nothing on an existing one. domain is not a field: the domain is the address.
Absent: the current name is kept (none on creation). Trimmed; "" or a blank name clears it.
Absent: the current default is kept. Present: the reference of an active fragment of this site, exact and case-sensitive (not trimmed), which becomes the default — so it is refused on the call that creates the site.
^[A-Za-z0-9/_.:-]{1,200}$Response
The site existed and was updated (or left unchanged).
A site: a domain the organisation publishes on.
Stable site id (sit_…).
The organisation id (acc_…).
The bare domain, normalized: lowercase, without scheme, path or port. www. and the apex are two sites.
Display name, or null.
The site icon. Null for a site created through this API until the site is first opened in the console.
The site default fragment id (frg_…), or null when the site has no default.
The site default fragment reference; null when the site has no default, or when that fragment has no reference.
Creation time, UTC.
