MediaWiki API help
This is an auto-generated MediaWiki API documentation page.
Documentation and examples: https://www.mediawiki.org/wiki/API
action=undelete
- This module requires read rights.
- This module requires write rights.
- This module only accepts POST requests.
- Source: MediaWiki
- License: GPL-2.0-or-later
Restore revisions of a deleted page.
A list of deleted revisions (including timestamps) can be retrieved through prop=deletedrevisions, and a list of deleted file IDs can be retrieved through list=filearchive.
- title
- Title of the page to restore. 
- This parameter is required.
- reason
- Reason for restoring. 
- Default: (empty)
- tags
- Change tags to apply to the entry in the deletion log. 
- Values (separate with | or alternative):
- timestamps
- Timestamps of the revisions to restore. If both timestamps and fileids are empty, all will be restored. 
- Type: list of timestamps (allowed formats)
- Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
- fileids
- IDs of the file revisions to restore. If both timestamps and fileids are empty, all will be restored. 
- Type: list of integers
- Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
- watchlist
- Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch. 
- One of the following values: watch, unwatch, preferences, nochange
- Default: preferences
- token
- A "csrf" token retrieved from action=query&meta=tokens 
- This parameter is required.
- Undelete page Main Page.
- api.php?action=undelete&title=Main%20Page&token=123ABC&reason=Restoring%20main%20page [open in sandbox]
- Undelete two revisions of page Main Page.
- api.php?action=undelete&title=Main%20Page&token=123ABC×tamps=2007-07-03T22:00:45Z|2007-07-02T19:48:56Z [open in sandbox]