From MediaWiki.org
Jump to navigation Jump to search
Translate this page; This page contains changes which are not marked for translation.

Other languages:
dansk • ‎Deutsch • ‎English • ‎español • ‎français • ‎日本語 • ‎polski • ‎română • ‎русский • ‎sicilianu • ‎中文
This page is part of the MediaWiki action API documentation.

MediaWiki action API

v · d · e

For the deprecated action module, see API:Tokens (action)API:Tokens (action).

Gets tokens required by data-modifying actions. If you request one of these actions without providing a token, the API returns an error code such as notoken. This module does not use a prefix. The csrf (cross-site request forgery) token corresponds to the majority of older tokens, like edit and move, that were retrieved using the API action tokens (deprecated in MediaWiki 1.24).


  • type: Type of token(s) to request. (Default: csrf)
    • csrf
    • watch
    • patrol
    • rollback
    • userrights
    • login 1.27+
    • createaccount 1.27+


Possible errors[edit]

In addition to the usual errors, other errors may be returned in the following format:

<?xml version="1.0"?>
<api batchcomplete="">
    <tokens xml:space="preserve">Unrecognized value for parameter <var>type</var>: XXX.</tokens>
    <tokens />

Possible errors include:

  • Unrecognized value for parameter type: XXX.

See also[edit]