"As a Moderator, I want to roll back a user's revisions to a page, so that vandalism, spam, and other bad content can be removed."
MediaWiki lets some users roll back a page's history. This is a short cut to revert to the most recent revision by someone who isn't the author of the latest revision. If a user has been vandalising a page or otherwise making bad edits, this will take away the effect of all those edits.
So, if a page has a history with revisions 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, and revisions 7-10 were made by the same user, and 6 was not, rolling back the page will revert to the same content as revision 6.
POST /page/{title}/rollback
Rolls back the history of the page to the latest revision that was not created by the most recent revision's author.
Request body: JSON
- name: name of the author of the most recent revision, or IP or other identifier if they are not authenticated
- id: id of the author of the most recent revision
One of id or name is required.
Notable request headers: none
Status code:
- 200: the rollback occurred; content is the new revision created by the rollback
- 400: no such user, or the page has only one revision
- 404: no such page
- 409: conflict; there has been another revision made since the named user made their last revision
Notable response headers: none
Response body: JSON, medium representation of the revision created by the rollback
- id: revision ID of the new revision created by the undo (not the revision(s) that was (were) undone)
- page: Object with these fields
- id: ID of the page
- title: current title of the page (might have been changed)
- user: user who made the change, object with these fields
- id: ID of the user or null for anonymous
- name: name of the user or unique identifier for anonymous
- comment: User comment ("edit summary") describing the change that generated this revision
- timestamp: time the revision was made
- size: size of the revision in "bogobytes" (as from DB, usually bytes)
- delta: change from previous revision in "bogobytes" (as from DB, usually bytes)
- minor: whether the revision was minor; boolean