Document actions
Accept changes
Accept every tracked change in a DOCX and get a clean copy.
POST
Accepts every tracked change in a DOCX, as Word’s “Accept All Changes” does, and returns a clean copy. Insertions and moves are kept, deletions are dropped, and pending formatting changes are applied. Optionally it also removes editing restrictions. The original file is not changed.
A file with no tracked changes still succeeds. The output is then a copy, and
summary.changes_accepted is 0.
The action runs as an operation of type document_action: the response comes back straight away, and the work runs in the background. Wait for it with wait, a callback_url, or Get operation. The new files land in your private space. The input files are not changed. Document actions use no credits.
Authentication
Send an API key, or an OAuth access token with both thefiles:write and files:read scopes. files:write lets the action create its output; files:read lets it read the inputs. A token without either gets 403 with "error": "insufficient_scope".
Path parameters
Headers
A unique key for this request, such as a UUID, up to 255 characters. A repeat with the same key within 30 days returns
200 with the same operation and does the work once. A repeat with a different body returns 409 idempotency_key_reused.Body parameters
The body is optional: send{} or nothing for the defaults.
Also remove editing restrictions, such as “tracked changes only” or “read only”. This does not remove a password that encrypts the file.
Seconds to wait for the action to finish before responding, from
0 to 20. Most documents finish inside 20.A public HTTPS URL that receives a signed
operation.succeeded, operation.failed or operation.cancelled event when the action finishes. An API key signs it with its webhook secret. For an OAuth app, the response carries the callback_secret that signs it. See Callbacks for OAuth apps.Query parameters
true answers an operation that is still queued or running with 202 Accepted, a Location header and a
Retry-After header in seconds. Location is the operation’s Get operation
URL, with respond_async=true. Poll it until the response is not 202; that response is the finished operation.
A succeeded operation is a 200. A failed or cancelled one is a 422 with the operation as its body, so an
automation’s step fails instead of passing on a result that is not there. Power Automate and Logic Apps follow
this pattern by themselves. Pass true to turn it on. A value that is not a boolean is a 400, and a call that
starts work then starts nothing.Response
Returns202 with an operation of type document_action. Its resource is the input file. A repeat with the same Idempotency-Key returns 200 with the same operation.
With respond_async=true, the status code follows the operation’s status instead, as the respond_async query parameter above describes.
When status is succeeded, result is { "action": "accept_changes", "file_ids", "summary" }. file_ids holds one id: the clean DOCX. summary is { "changes_accepted", "protection_removed" }: how many tracked changes were accepted, and whether editing restrictions were removed.
When status is failed, error.code says why:
Only for an OAuth app that passed
callback_url: the secret that signs the callback. A retry with the same Idempotency-Key returns it again; no other response does.