MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

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

action=block

(main | block)
  • This module requires read rights.
  • This module requires write rights.
  • This module only accepts POST requests.
  • Source: MediaWiki
  • License: GPL-2.0-or-later

Blokir pengguna.

Parameters:
user

Nama pengguna, alamat IP, atau rentang alamat IP untuk diblokir.

Type: user, by any of nama pengguna, IP, rentang IP dan ID pengguna (mis. "#12345")
userid
Deprecated.

Specify user=#ID instead.

Type: integer
expiry

Waktu kedaluwarsa. Dapat berupa waktu relatif (seperti 5 bulan atau 2 minggu) atau waktu absolut (seperti 2014-09-18T12:34:56Z). Jika diatur ke selamanya, tak terbatas, atau tidak pernah, pemblokiran itu tidak akan berakhir.

Default: never
reason

Alasan pemblokiran.

Default: (empty)
anononly

Blokir hanya pengguna anonim (seperti menonaktifkan suntingan anonim untuk alamat IP ini).

Type: boolean (details)
nocreate

Cegah pembuatan akun.

Type: boolean (details)
autoblock

Blokir alamat IP terakhir yang digunakan pengguna ini, dan semua alamat IP berikutnya yang mereka coba gunakan untuk menyunting.

Type: boolean (details)
noemail

Cegah pengguna mengirimkan surel melalui wiki. (Membutuhkan hak blockemail).

Type: boolean (details)
hidename

Hide the username from the block log. (Requires the hideuser right).

Type: boolean (details)
allowusertalk

Allow the user to edit their own talk page (depends on $wgBlockAllowsUTEdit).

Type: boolean (details)
reblock

Jika pengguna tersebut sudah diblokir, atur ulang setelah pemblokirannya.

Type: boolean (details)
watchuser

Watch the user's or IP address's user and talk pages.

Type: boolean (details)
tags

Change tags to apply to the entry in the block log.

Values (separate with | or alternative):
partial

Block user from specific pages or namespaces rather than the entire site.

Type: boolean (details)
pagerestrictions

List of titles to block the user from editing. Only applies when partial is set to true.

Separate values with | or alternative.
Maximum number of values is 10.
namespacerestrictions

List of namespace IDs to block the user from editing. Only applies when partial is set to true.

Values (separate with | or alternative): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 828, 829, 2300, 2301, 2302, 2303
To specify all values, use *.
token

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

This parameter is required.
Examples:
Blokir alamat IP 192.0.2.5 selama tiga hari dengan alasan Serangan pertama.
api.php?action=block&user=192.0.2.5&expiry=3%20days&reason=First%20strike&token=123ABC [open in sandbox]
Block user Vandal indefinitely with a reason, and prevent new account creation and email sending.
api.php?action=block&user=Vandal&expiry=never&reason=Vandalism&nocreate=&autoblock=&noemail=&token=123ABC [open in sandbox]