API:Rollback

POST Request to revert the last series of edits made by one user to a given page.

Note: This functionality is identical to the one provided by the rollback links in the graphical interface on history page.

Example
Making any POST request is a multi-step process:


 * 1. Log in, via one of the methods described in.


 * 2. GET a :


 * 3. Send a POST request, with the CSRF token, to take action on a page and in this process gain  rights to the given page:


 * 4. GET a rollback token:


 * If your wiki is using MediaWiki 1.24+, follow these instructions:
 * If your wiki is using MediaWiki 1.24+, follow these instructions:




 * Rollback tokens aren't universal: they're not only different for every login, but also depend on the title of the page and the name of the user whose edits are to be rolled back.


 * For MediaWiki 1.23 or earlier, follow these instructions:
 * For MediaWiki 1.23 or earlier, follow these instructions:



POST Request
Send a POST request, with a rollback token to revert a user's edits to the Sandbox page.

Note: In this example, all parameters are passed in a GET request just for the sake of simplicity. However, action=rollback requires POST requests; GET requests will cause an error.



Response
The Response section below is for the final POST request, to revert the edits to the Sandbox page.

Sample code
rollback.py

Permissions
Rollback requires both the   and the   right on the target page; currently, this means that OAuth consumers, bot passwords etc. require both the   and the   grant –   alone is not enough!

Possible errors
In addition to 1>Special:MyLanguage/API:Errors#Standard error messages|the usual stuff:

Parameter history

 * v1.24: Introduced
 * v1.27: Introduced
 * v1.17: Introduced

Additional notes

 * Optionally, both the rollback and the edits being rolled back can be marked as bot, which hides them from Special:RecentChanges by default.