Skip to content
View as Markdown

Change a hosted document by block.

POST/v1/abilities/workspace.doc.patch

Change a hosted document by block. ALL-OR-NOTHING: if any op fails nothing is written. Two optional concurrency guards — if_revision (whole doc) and per-op if_block_rev (one block); a mismatch returns conflict:true and changes nothing, so re-read and retry. claim marks a block as yours for 15 minutes and blocks other actors’ writes to it — this is how two agents work one document at once without a merge.

Required
Yes
Content type
  • application/json
  • inputWorkspaceDocPatchInputrequired
    Show 5 properties
    • idstringrequired
    • if_revisionnumberoptional

      doc-level optimistic guard; 409 on mismatch

    • actorstringoptional

      who is writing (defaults to the key’s tenant). Claims are per-actor.

    • forcebooleanoptional

      amend a closed document

    • opsobject[]required
      Show array — 5 properties
      • opstringrequired
        Allowed values: replace, insert_after, insert_before, delete, claim, release
      • block_idstringoptional

        target (or anchor, for inserts)

      • blockobjectoptional

        the new block, for replace / insert_*

      • if_block_revnumberoptional

        block-level optimistic guard; 409 on mismatch

      • forcebooleanoptional

        override another actor’s live claim

  • contextCallContextoptional

    Optional call context. The tenant always comes from the credential: tenantId is honoured only by a credential allowed to address sub-tenants, and then nests under the credential’s own tenant.

    Show 3 properties
    • tenantIdstringoptional

      Sub-tenant to act for (sub-tenant credentials only).

    • runIdstringoptional

      The trust run (from trust.preflight) this call executes under.

    • verticalIdstringoptional

      Vertical to attribute created records to.

Schema shown for 200 · application/json

  • result

    The ability’s return value. Its shape depends on the ability.