API:Tag
From MediaWiki.org
| This page is part of the MediaWiki action API documentation. |
MediaWiki action API
- Introduction and quick start
- FAQ
- Tutorial
- 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
| tag | ||
|---|---|---|
| Add or remove change tags from individual revisions or log entries. This module cannot be used as a Generator. |
||
| Prefix | none | |
| Required rights | changetags | |
| Post only? | Yes | |
| Generated help | Current | |
| Version added |
|
|
Parameters[edit]
rcid: One or more recent changes IDs from which to add or remove the tag. No more than 50 (500 for bots) allowed.revid: One or more revision IDs from which to add or remove the tag. No more than 50 (500 for bots) allowed.logid: One or more log entry IDs from which to add or remove the tag. No more than 50 (500 for bots) allowed.add: Tags to add.remove: Tags to remove. No more than 50 (500 for bots) allowed.reason: Reason for the change.tags: Tags to apply to the log entry that will be created as a result of this action. 1.29+token: A "csrf" token retrieved from action=query&meta=tokens.
| The following documentation is the output of Special:ApiHelp/tag, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
action=tag
(main | tag)
- This module requires read rights.
- This module requires write rights.
- This module only accepts POST requests.
- Source: MediaWiki
- License: GPL-2.0+
Add or remove change tags from individual revisions or log entries.
Parameters:
- rcid
-
One or more recent changes IDs from which to add or remove the tag.
- Type: list of integers
- Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
- revid
-
One or more revision IDs from which to add or remove the tag.
- Type: list of integers
- Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
- logid
-
One or more log entry IDs from which to add or remove the tag.
- Type: list of integers
- Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
- add
-
Tags to add. Only manually defined tags can be added.
- Values (separate with | or alternative):
- remove
-
Tags to remove. Only tags that are either manually defined or completely undefined can be removed.
- Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
- reason
-
Reason for the change.
- Default: (empty)
- tags
-
Tags to apply to the log entry that will be created as a result of this action.
- Values (separate with | or alternative):
- token
-
A "csrf" token retrieved from action=query&meta=tokens
- This parameter is required.
Examples:
- Add the vandalism tag to revision ID 123 without specifying a reason
- api.php?action=tag&revid=123&add=vandalism&token=123ABC [open in sandbox]
- Remove the spam tag from log entry ID 123 with the reason Wrongly applied
- api.php?action=tag&logid=123&remove=spam&reason=Wrongly+applied&token=123ABC [open in sandbox]