MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

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

action=protect

(main | protect)
  • This module requires read rights.
  • This module requires write rights.
  • This module only accepts POST requests.
  • Source: MediaWiki
  • Licenza: GPL-2.0+

Change the protection level of a page.

Parametri:
title

Title of the page to (un)protect. Cannot be used together with pageid.

pageid

ID of the page to (un)protect. Cannot be used together with title.

Type: integer
protections

List of protection levels, formatted action=level (e.g. edit=sysop).

Note: Any actions not listed will have restrictions removed.

Questo parametro è obbligatorio.
Separate values with |. Il numero massimo di valori è 50 (500 per i bot).
expiry

Expiry timestamps. If only one timestamp is set, it'll be used for all protections. Use infinite, indefinite, infinity, or never, for a never-expiring protection.

Separate values with |. Il numero massimo di valori è 50 (500 per i bot).
Predefinito: infinite
reason

Reason for (un)protecting.

Predefinito: (vuoto)
cascade

Enable cascading protection (i.e. protect transcluded templates and images used in this page). Ignored if none of the given protection levels support cascading.

Type: boolean (details)
watch
Deprecato.

If set, add the page being (un)protected to the current user's watchlist.

Type: boolean (details)
watchlist

Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch.

One of the following values: watch, unwatch, preferences, nochange
Predefinito: preferences
token

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

Questo parametro è obbligatorio.