API:Managetags
From MediaWiki.org
(Redirected from API:Tag management)
| 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
| managetags | ||
|---|---|---|
| Perform management tasks relating to change tags This module cannot be used as a Generator. |
||
| Prefix | ||
| Required rights | managechangetags | |
| Post only? | Yes | |
| Generated help | Current | |
| Version added |
|
|
Parameters[edit]
operation: Which operation to perform. Possible values: create, delete, activate, deactivate.tag: Tag to create, delete, activate or deactivate. For tag creation, the tag must not exist. For tag deletion, the tag must exist. For tag activation, the tag must exist and not be in use by an extension. For tag deactivation, the tag must be currently active and manually defined.reason: An optional reason for creating, deleting, activating or deactivating the tag.ignorewarnings: Whether to ignore any warnings that are issued during the operation. Type: booleantoken: A "csrf" token retrieved fromaction=query&meta=tokens.
| The following documentation is the output of Special:ApiHelp/managetags, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
action=managetags
(main | managetags)
- This module requires read rights.
- This module requires write rights.
- This module only accepts POST requests.
- Source: MediaWiki
- License: GPL-2.0+
Perform management tasks relating to change tags.
Parameters:
- operation
-
Which operation to perform:
- create
- Create a new change tag for manual use.
- delete
- Remove a change tag from the database, including removing the tag from all revisions, recent change entries and log entries on which it is used.
- activate
- Activate a change tag, allowing users to apply it manually.
- deactivate
- Deactivate a change tag, preventing users from applying it manually.
- This parameter is required.
- One of the following values: create, delete, activate, deactivate
- tag
-
Tag to create, delete, activate or deactivate. For tag creation, the tag must not exist. For tag deletion, the tag must exist. For tag activation, the tag must exist and not be in use by an extension. For tag deactivation, the tag must be currently active and manually defined.
- This parameter is required.
- reason
-
An optional reason for creating, deleting, activating or deactivating the tag.
- ignorewarnings
-
Whether to ignore any warnings that are issued during the operation.
- Type: boolean (details)
- tags
-
Change tags to apply to the entry in the tag management log.
- Values (separate with | or alternative):
- token
-
A "csrf" token retrieved from action=query&meta=tokens
- This parameter is required.
Examples:
- Create a tag named spam with the reason For use in edit patrolling
- api.php?action=managetags&operation=create&tag=spam&reason=For+use+in+edit+patrolling&token=123ABC [open in sandbox]
- Delete the vandlaism tag with the reason Misspelt
- api.php?action=managetags&operation=delete&tag=vandlaism&reason=Misspelt&token=123ABC [open in sandbox]
- Activate a tag named spam with the reason For use in edit patrolling
- api.php?action=managetags&operation=activate&tag=spam&reason=For+use+in+edit+patrolling&token=123ABC [open in sandbox]
- Deactivate a tag named spam with the reason No longer required
- api.php?action=managetags&operation=deactivate&tag=spam&reason=No+longer+required&token=123ABC [open in sandbox]