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=protect
- Denna modul kräver läsrättigheter.
 - Denna modul kräver skrivrättigheter.
 - Denna modul accepterar endast POST-begäranden.
 - Source: MediaWiki
 - License: GPL-2.0-or-later
 
Ändra skyddsnivån för en sida.
- 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.
- Typ: heltal
 - protections
 List of protection levels, formatted action=level (e.g. edit=sysop). A level of all means everyone is allowed to take the action, i.e. no restriction.
Note: Any actions not listed will have restrictions removed.
- Den här parametern är obligatorisk.
 - Separera värden med | eller alternativ.
 - Högsta antalet värden är 50 (500 för klienter som tillåts högre gränser).
 - 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.
- Separera värden med | eller alternativ.
 - Högsta antalet värden är 50 (500 för klienter som tillåts högre gränser).
 - Standard: infinite
 - reason
 Reason for (un)protecting.
- Default: (empty)
 Change tags to apply to the entry in the protection log.
- Värden (separerade med | eller alternativ):
 - 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
 - Föråldrad.
 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 (ignored for bot users) or do not change watch.
- Ett av följande värden: nochange, preferences, unwatch, watch
 - Standard: preferences
 - token
 A "csrf" token retrieved from action=query&meta=tokens
- Den här parametern är obligatorisk.
 
- Skydda en sida
 - api.php?action=protect&title=Huvudsida&token=123ABC&protections=edit=sysop|move=sysop&cascade=&expiry=20070901163000|never [open in sandbox]
 - Unprotect a page by setting restrictions to all (i.e. everyone is allowed to take the action).
 - api.php?action=protect&title=Huvudsida&token=123ABC&protections=edit=all|move=all&reason=Lifting%20restrictions [open in sandbox]
 - Unprotect a page by setting no restrictions.
 - api.php?action=protect&title=Huvudsida&token=123ABC&protections=&reason=Lifting%20restrictions [open in sandbox]