⧼api-help-title⧽
action=block
(main | block)
- ⧼api-help-flag-readrights⧽
- ⧼api-help-flag-writerights⧽
- ⧼api-help-flag-mustbeposted⧽
- ⧼api-help-source⧽
- ⧼api-help-license⧽
- user
- ⧼apihelp-block-param-user⧽
- Type: user, by any of username, IP, IP range and user ID (e.g. "#12345")
- userid
- ⧼api-help-param-deprecated⧽
- ⧼apihelp-block-param-userid⧽
- Type: integer
- expiry
- ⧼apihelp-block-param-expiry⧽
- Default: never
- reason
- ⧼apihelp-block-param-reason⧽
- Default: (empty)
- anononly
- ⧼apihelp-block-param-anononly⧽
- Type: boolean
- nocreate
- ⧼apihelp-block-param-nocreate⧽
- Type: boolean
- autoblock
- ⧼apihelp-block-param-autoblock⧽
- Type: boolean
- noemail
- ⧼apihelp-block-param-noemail⧽
- Type: boolean
- hidename
- ⧼apihelp-block-param-hidename⧽
- Type: boolean
- allowusertalk
- ⧼apihelp-block-param-allowusertalk⧽
- Type: boolean
- reblock
- ⧼apihelp-block-param-reblock⧽
- Type: boolean
- watchuser
- ⧼apihelp-block-param-watchuser⧽
- Type: boolean
- tags
- ⧼apihelp-block-param-tags⧽
- Values (separate with U+007C (pipe), or prefix the list with U+001F and separate with U+001F):
- partial
- ⧼apihelp-block-param-partial⧽
- Type: boolean
- pagerestrictions
- ⧼apihelp-block-param-pagerestrictions⧽
- Type: page title
- Separate values with "|", or prefix the list with U+001F and separate with U+001F.
- Maximum number of values is 10.
- Only accepts pages that exist.
- namespacerestrictions
- ⧼apihelp-block-param-namespacerestrictions⧽
- Values (separate with U+007C (pipe), or prefix the list with U+001F and separate with U+001F): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
- To specify all values, use *.
- token
- ⧼api-help-param-token⧽
- This parameter is required.
- ⧼apihelp-block-example-ip-simple⧽
- api.php?action=block&user=192.0.2.5&expiry=3%20days&reason=First%20strike&token=123ABC ⧼api-help-open-in-apisandbox⧽
- ⧼apihelp-block-example-user-complex⧽
- api.php?action=block&user=Vandal&expiry=never&reason=Vandalism&nocreate=&autoblock=&noemail=&token=123ABC ⧼api-help-open-in-apisandbox⧽