Contents

Save browser-edited DOCX bytes to the selected document version

Validates serialized DOCX bytes through the engine, updates the exact selected version without advancing the version counter, and rejects stale expected_content_sha256 values without overwriting. Creating a version is an explicit separate action.

POST /documents/{documentId}/content

Path parameters

  • documentId string Required

Headers

  • Authorization string Required

    Bearer <session token>: the signed-in user’s Scaffold session token.

  • x-org-id string Required

Body

  • content_base64 string Required

    Serialized DOCX package bytes.

  • expected_content_sha256 string

    Content hash observed when this editor snapshot began.

  • client_edit_id string

    Client-generated, one per save and the same on every retry of it. A repeat returns the document as it stands, with `replayed: true`, and writes nothing, rather than applying it again or a 409: a client that resends a fixed id with identical bytes gets that 200 each time. `savedContentSha256` is the hash that save produced: if `document.contentSha256` differs, someone has saved since, and the client must take `contentBase64` before it saves again. Used for different bytes, or by someone else, it is refused (409 DOCUMENT_SAVE_ID_REUSED). Kept as long as the save's activity entry.

  • carry object[]

    Paragraphs the person edited that held pending tracked changes, in document order. The editor drops such a paragraph's changes, so the engine puts the stored paragraph back with the person's text edit written in untracked, outside every change. The result must still hold every stored pending change, or the save is refused. More than 50 entries, or a text over 20000 characters, is refused (409, reason `too_large`) when the save needs the carry; a malformed entry is a 400.

    Show 2 fields
    • before_text string Required

      The paragraph's visible text as the editor showed it before the edit.

    • after_text string Required

      The paragraph's visible text now.