Contents

Apply a bounded structural DOCX operation batch

Language edits use {find, replace}; structured edits use {op, ...}. By default, valid items are applied even when another item fails, with a 207 response containing appliedEditIndexes, failedEdits, and retryArguments for only the failed items. Set atomic=true for all-or-nothing behavior. For insert_paragraph, prefer before_text or after_text containing a unique nearby paragraph excerpt. Otherwise send target_block_index together with position=before or position=after. format_text_range offsets are zero-based and end-exclusive; expected_text guards the complete selected range, while expected_text_prefix guards a long range's start.

POST /documents/{documentId}/edits/batch

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

  • edits object[]
  • operations object[]

    Backward-compatible alias for edits.

  • changes object[]

    Accepted natural-language alias for edits.

  • atomic boolean

    Default false