MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

Documentation and examples: https://www.mediawiki.org/wiki/API

action=globalblock

(main | globalblock)
  • This module requires read rights.
  • This module requires write rights.
  • This module only accepts POST requests.
  • Source: GlobalBlocking
  • License: GPL-2.0+

Globally block or unblock a user.

Parameters:
target

The target IP address.

This parameter is required.
expiry

If specified, will block or reblock the user. Determines how long the block will last for, e.g. "5 months" or "2 weeks". If set to "infinite" or "indefinite" the block will never expire.

unblock

If specified, will unblock the user.

Type: boolean (details)
reason

The reason for blocking/unblocking.

This parameter is required.
anononly

Specify this if the block should only affect logged-out users.

Type: boolean (details)
token

A "csrf" token retrieved from action=query&meta=tokens

This parameter is required.
Example:
Block 192.0.2.1 indefinitely with reason "Cross-wiki abuse"
api.php?action=globalblock&target=192.0.2.1&expiry=indefinite&reason=Cross-wiki%20abuse&token=123ABC