Replace one exact XML fragment as a tracked change
expected_xml must match exactly one fragment of the document's current document.xml (read it with GET .../xml first). A plain-text replacement_xml is auto-wrapped as a tracked w:del/w:ins by the engine.
/documents/{documentId}/edits/xml-patch Path parameters
documentIdstring Required
Headers
Authorizationstring RequiredBearer <session token>: the signed-in user’s Scaffold session token.
x-org-idstring Required
Body
target_xpathstring Requiredexpected_xmlstring Requiredreplacement_xmlstring Requiredjustificationstringauthorstring
Returns
documentobjectThe persisted upload/document row, as returned by every route that creates or mutates upload content (create, save draft, rename, delete, new version, revision-apply, redline edits).
Show 19 fields
idstringartifactIdstring | nullorgIdstringcreatedByUserIdstring | nullfileNamestringmimeTypestringsizeBytesintegerpurposestringOne of
source_docplaybookclientReferenceIdstring | nulldocumentSeriesIdstringdocumentVersionintegerparentUploadIdstring | nullversionKindstringOne of
originalworking_draftstorageKeystring | nullcontentSha256string | nullhasBinarybooleanstatusstringcreatedAtstringupdatedAtstring
targetXpathstringrevisionsobject[]Show 7 fields
ordinalinteger RequiredThe change's position in document order.
change_idstring RequiredThe id to pass in accepted_change_ids or rejected_change_ids.
kindstring Requiredinsert and delete are text changes, paragraph_mark is an inserted or deleted paragraph mark (a paragraph split or join; it carries no text of its own), proposed is a Scaffold change marker, and the -prop-change kinds are tracked formatting or structure changes.
One of
insertdeleteparagraph_markproposedr-prop-changep-prop-changetbl-prop-changetr-prop-changetc-prop-changesect-prop-changeauthorstring | nulldatestring | nulltext_previewstring RequiredA short excerpt of the changed text.
justificationstring | nullThe reason recorded with the change, shown to the reviewer.