API:Revisiondelete
Jump to navigation
Jump to search
| This page is part of the MediaWiki action API documentation. |
MediaWiki action API
- Introduction and quick start
- FAQ
- Formats
- Error reporting
- Restricting usage
- Cross-site requests
- Authentication
- Queries
- Searching (by title, content, coordinates...)
- Parsing wikitext and expanding templates
- Purging pages' caches
- Parameter information
- Changing wiki content
- Create and edit pages
- Move pages
- Merge pages
- Rollback
- Delete pages
- Restore deleted revisions
- (Un)protect pages
- (Un)block users
- (Un)watch pages
- Mark revisions of watched pages as visited
- Send email
- Patrol changes
- Import pages
- Change user group membership
- Upload files
- User options
- Tokens
- Page language
- More...
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
- Asserting
| revisiondelete | ||
|---|---|---|
| Delete and undelete revisions. This module cannot be used as a Generator. |
||
| Prefix | ||
| Required rights | deleterevision | |
| Post only? | Yes | |
| Generated help | Current | |
| Version added |
|
|
Delete and undelete revisions.
Parameters[edit]
type: Type of revision deletion being performed. Possible values: revision, archive, oldimage, filearchive, logging.target: Page title for the revision deletion, if required for the type. Targets are always required for archive, oldimage, and filearchive operations, and may be required for revision and logging operations.ids: Identifiers for the revisions to be deleted. No more than 50 (500 for bots) allowed.hide: What to hide for each revision. Possible values: content, comment, user.show: What to unhide for each revision. Possible values: content, comment, user.suppress: Whether to suppress data from administrators as well as others. Possible values: yes, no, nochange. (Default: nochange)reason: Reason for the deletion or undeletion.tags: Tags to apply to the entry in the deletion log. 1.29+token: A "csrf" token retrieved from action=query&meta=tokens
Example[edit]
Hide all information about revision ID 71. (The target, Sample Page, is unnecessary in this case.)
api.php? action=revisiondelete& type=revision& ids=71& hide=content|comment|user& reason=Because& token=%2B%5C [try in ApiSandbox]
| Result |
|---|
{
"revisiondelete": {
"status": "Success",
"target": "Sample Page",
"items": [
{
"status": "Success",
"id": 71,
"timestamp": "2016-12-17T03:16:23Z",
"userhidden": "",
"commenthidden": "",
"texthidden": "",
"userid": 4,
"user": "Test User",
"comment": "This should get revdel'd"
}
]
}
}
|
| The following documentation is the output of Special:ApiHelp/revisiondelete, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
action=revisiondelete
(main | revisiondelete)
- This module requires read rights.
- This module requires write rights.
- This module only accepts POST requests.
- Source: MediaWiki
- License: GPL-2.0-or-later
Delete and undelete revisions.
Parameters:
- type
Type of revision deletion being performed.
- This parameter is required.
- One of the following values: revision, archive, oldimage, filearchive, logging
- target
Page title for the revision deletion, if required for the type.
- ids
Identifiers for the revisions to be deleted.
- This parameter is required.
- Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
- hide
What to hide for each revision.
- Values (separate with | or alternative): content, comment, user
- show
What to unhide for each revision.
- Values (separate with | or alternative): content, comment, user
- suppress
Whether to suppress data from administrators as well as others.
- One of the following values: yes, no, nochange
- Default: nochange
- reason
Reason for the deletion or undeletion.
- tags
Tags to apply to the entry in the deletion log.
- Values (separate with | or alternative):
- token
A "csrf" token retrieved from action=query&meta=tokens
- This parameter is required.
Examples:
- Hide content for revision 12345 on the page Main Page.
- api.php?action=revisiondelete&target=Main%20Page&type=revision&ids=12345&hide=content&token=123ABC [open in sandbox]
- Hide all data on log entry 67890 with the reason BLP violation.
- api.php?action=revisiondelete&type=logging&ids=67890&hide=content|comment|user&reason=BLP%20violation&token=123ABC [open in sandbox]