> ## Documentation Index
> Fetch the complete documentation index at: https://opentrain.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Apply Changeset

> Atomically apply a changeset — the single direct write path for all content.

Applies a changeset atomically: **all operations commit or none do**. This is the only direct write path for page content and structure. Base revision numbers and checksums in the operations guard against concurrent edits; a guarded mismatch returns HTTP `409` with the same typed body and structured conflicts instead of a partial write.

**Requirements:** `instructions:write` + workspace `EDITOR` or `OWNER` + a verified (claimed) account.

## Request

The shared changeset body (see [validate](/docs/developers/api-reference/instructions/validate-changeset)). Send an `Idempotency-Key` header: replaying the same key returns the original result with `idempotentReplay: true`; the same key with a **different** body is a `409`.

## Response

Returns `200` when applied, `409` (same body shape) when conflicted.

<ResponseField name="applied" type="boolean">
  Whether the write committed.
</ResponseField>

<ResponseField name="changesetId" type="string | null">
  The recorded changeset (status `APPLIED`).
</ResponseField>

<ResponseField name="idempotentReplay" type="boolean">
  `true` when the `Idempotency-Key` matched a previously applied changeset.
</ResponseField>

<ResponseField name="manualRevisions" type="object[]">
  New head revisions per touched manual: `{manualId, revisionNumber}`.
</ResponseField>

<ResponseField name="pageRevisions" type="object[]">
  New per-page revisions: `{pageId, revisionNumber, checksum}` — including server-assigned ids for pages created via `new:` keys.
</ResponseField>

<ResponseField name="conflicts" type="object[]">
  Structured conflicts when `applied` is `false`. On `REVISION_MISMATCH`, re-read the page, rebase your operations, and retry.
</ResponseField>
