Save a person's paragraph edits as their own tracked changes (Suggesting mode)
The review pane sends each paragraph the person changed: its visible text as they saw it and as they left it. The API names the change from the acting user's record (the Settings display name, or the email when that is empty or equal to it) and never from the request body; a name that starts with "Scaffold Assistant" is refused. The engine writes the word-level difference as w:del/w:ins under that name, withdraws and re-applies the person's own pending changes in the paragraph, and refuses a paragraph holding anyone else's pending change. The document is saved in place (same id and version), guarded by expected_content_sha256. At most 20 changes and 20,000 characters per text.
/documents/{documentId}/suggestions Path parameters
documentIdstring Required
Headers
Authorizationstring RequiredBearer <session token>: the signed-in user’s Scaffold session token.
x-org-idstring Required
Body
expected_content_sha256string Requiredchangesobject[] RequiredShow 5 fields
kindstring RequiredOne of
replaceinsert_afterdeleteblock_indexinteger RequiredEvery w:p in body order, table-cell paragraphs included and text-box paragraphs excluded. Changes apply in order; an insert_after shifts later indexes by one.
before_textstring Requiredafter_textstringRequired for replace and insert_after.
justificationstringOptional: why the person made this change. Trimmed, with runs of whitespace collapsed to one space; empty after that means none, and more than 280 characters after that is DOCUMENT_SUGGESTION_INVALID. Every tracked change this item writes carries it, and it comes back as the revision's and the Track entry's justification. Re-editing your own suggestion without one keeps the reason it had. Shown as plain text.