Roll a revision back to a version
revert_page_revision_to_versionUndo recent saves on a page's current draft: keeps the saves up to and including saveNumber and deletes every newer one. Read get_page_revisions first: the draft head (isDraftHead) lists its saves as [{ number, savedAt }] and its headAnchor. Pass that revision id, the save number to keep, and the headAnchor as expectedHeadAnchor. 0 keeps none of the draft's saves (back to the state the draft started from). Edits one person makes within about five minutes of each other share one save number, so undoing that number undoes all of them.
Refused unless the revision is the page's current draft (not the published one), the draft has not changed since the headAnchor was read, and a newer save exists. WARNING: deleted saves cannot be recovered.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | The page the revision belongs to | |
| version | No | Older name for saveNumber | |
| projectId | Yes | The project ID | |
| revisionId | Yes | The draft head revision id (isDraftHead in get_page_revisions) | |
| saveNumber | No | Keep the saves up to and including this number (from get_page_revisions saves); newer ones are deleted | |
| expectedHeadAnchor | Yes | The draft head's headAnchor from get_page_revisions; the undo is refused if the draft changed since |