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). Both fragments must be whole runs (w:r) with no revision markup of their own: the engine records a text change as a tracked w:del/w:ins and one run's formatting change as a tracked formatting change. Anything else (paragraph properties, paragraphs, tables, sections, text inside a run, half a field or bookmark, a comment reference, or a run holding anything but text, tabs, breaks and whole fields that only show their result) is refused. So is a run property off a short list (w:rStyle, w:rFonts, w:b, w:bCs, w:i, w:iCs, w:caps, w:smallCaps, w:strike, w:dstrike, w:rtl, w:cs, w:noProof, w:color, w:sz, w:szCs, w:spacing, w:w, w:kern, w:position, w:highlight, w:u, w:shd, w:vertAlign, w:lang) or not in the form Word reads, unless kept identical from expected_xml, and text a reviewer couldn't see: colored too close to what is behind it (run, paragraph or cell shading, else the page), under 4 points, squeezed, condensed or moved off its line, Unicode tag characters or a bidi override, a w:rStyle whose style (through basedOn) hides it or can't be read, or mc:AlternateContent. So is a patch that touches a pending change, the agent's own included, or sits in a paragraph or row whose mark is pending. The change is filed under exactly "Scaffold Assistant for <email>", and its id is the api's.
/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 Requiredjustificationstring
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
agentAuthorstringThe name this caller's agent edits under.
targetXpathstringcreatedChangeIdsstring[]The ids of the tracked changes this patch made.
createdChangeIdsCompletebooleanrevisionsobject[]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.