Change a hosted document by block.
/v1/abilities/workspace.doc.patchChange 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.
Request body
Section titled “Request body”inputWorkspaceDocPatchInputrequiredShow 5 properties
idstringrequiredif_revisionnumberoptionaldoc-level optimistic guard; 409 on mismatch
actorstringoptionalwho is writing (defaults to the key’s tenant). Claims are per-actor.
forcebooleanoptionalamend a closed document
opsobject[]requiredShow array — 5 properties
opstringrequiredAllowed values:replace,insert_after,insert_before,delete,claim,releaseblock_idstringoptionaltarget (or anchor, for inserts)
blockobjectoptionalthe new block, for replace / insert_*
if_block_revnumberoptionalblock-level optimistic guard; 409 on mismatch
forcebooleanoptionaloverride another actor’s live claim
contextCallContextoptionalOptional call context. The tenant always comes from the credential:
tenantIdis honoured only by a credential allowed to address sub-tenants, and then nests under the credential’s own tenant.Show 3 properties
tenantIdstringoptionalSub-tenant to act for (sub-tenant credentials only).
runIdstringoptionalThe trust run (from trust.preflight) this call executes under.
verticalIdstringoptionalVertical to attribute created records to.
Returns
Section titled “Returns”Schema shown for 200 · application/json
resultThe ability’s return value. Its shape depends on the ability.