Write a content key to the draft
Stages one key (a page, layout, fragment or data file). A layout's key is layouts/<name>.html and a fragment's is fragments/<name>.html; a <dotsy-fragment name> tag and a route's layout use the bare name. Nothing is live until you publish. The answer is 201 when the key is new and 200 when it replaced an existing one. Writing the same body again changes nothing.
Send { body, contentType? }. With ?format=post, send a blog post document { meta, body, head?, slug? } instead; the server builds the page from it. Keys under .dotsy/, .structure/, _intent/ and _data/ are reserved (400 reserved_key). For a body over about 60 KB, use PUT …/content-raw/{key} or a changeset with staged chunks.
Request
- Base URL: https://api.dotsy.ai
- URL: https://api.dotsy.ai/api/v1/sites/{slug}/content/{key}
- Auth: one of:
- HTTP bearer
- HTTP bearer
Path parameters
Site slug or site id (UUID). An old slug answers 301/308 and a site id 307 to the canonical slug path.
Percent-encode each segment; '/' may be sent raw or as %2F. Keys may contain '/'.
Query parameters
post: the body is a blog post document (PutPostRequest) rather than a file.
Headers
The ETag / contentHash you read, quoted or bare. If the key changed since, the write answers 409 conflict and changes nothing.
Request body
Example request
{
"body": "<h1>About us</h1><p>We make good things.</p>",
"contentType": "text/html; charset=utf-8"
}Response
Replaced an existing key.
Example response
{
"key": "about.html",
"contentType": "text/html; charset=utf-8",
"contentHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}Changes
No recorded changes to this operation across all 1 revision of this API.