Content

Stage many content writes and deletes at once

Stages writes and deletes (with their routes and menu items) to the draft in one call. Nothing is live until you publish.

The request is checked as a whole before anything is staged: a bad write, a reserved key, a CSS or JS file or an invalid menu item rejects the lot. Each write carries exactly one of body or bodyStaging. Bodies too big to send inline are uploaded in chunks first and referenced by bodyStaging.

A small changeset answers 200 with what was staged. A large one (many writes or many bytes; the server decides) is queued: the answer is 202 with a job, and you poll GET /api/v1/sites/{slug}/jobs/{id} until it succeeds or fails. A write whose ifMatch no longer matches is not applied and is listed in conflicts, with status 200. With atomic: true one stale ifMatch writes nothing instead, and the answer is 409 changeset_conflict.

post/api/v1/sites/{slug}/changeset

Request

  • Base URL: https://api.dotsy.ai
  • URL: https://api.dotsy.ai/api/v1/sites/{slug}/changeset
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Path parameters

slugstring required
Example:acme-studio

Site slug or site id (UUID). An old slug answers 301/308 and a site id 307 to the canonical slug path.

Request body

messagestring

Short note for the site's edit history (up to 2,000 characters).

atomicboolean

All or nothing. Every write's and delete's ifMatch is checked before any key is written: one stale key writes nothing and the answer is 409 changeset_conflict with conflicts. A changeset too large to apply in one request is checked against the draft before it is queued; a write that lands between that check and the queued job is still caught per key and listed in the job's conflicts.

Example request

{
  "writes": [
    {
      "key": "about.html",
      "body": "<h1>About us</h1><p>We make good things.</p>",
      "bodyStaging": "stg_9c1f0a",
      "route": {
        "path": "/about"
      }
    }
  ],
  "deletes": [
    "old-page.html",
    {
      "key": "older-page.html",
      "ifMatch": "9f2c…"
    }
  ],
  "message": "Add About page",
  "atomic": true
}

Response

Staged.

publishableboolean required

True when the draft has anything to publish.

versioninteger required

The site's published version counter.

skippedDeletesstring[]

Deletes that were ignored because the key is protected.

warningsstring[]

Non-blocking notes about tags that will not compose, one per problem, each as <key>: <code> — <what to change>. Codes: fragment_unclosed, fragment_bad_name, fragment_full_document, fragment_self_reference, fragment_attr_hyphen, legacy_paige_tag, layout_missing_content, unknown_dotsy_syntax. The write still happened. At most 50 are listed.

publishedfalse required

Always false: the change is staged in the draft until you publish.

hintstring required

Reminder that the change is staged and how to make it live.

Changes

No recorded changes to this operation across all 1 revision of this API.