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
- This module requires read rights.
- This module requires write rights.
- This module only accepts POST requests.
- ရင်းမြစ်: MediaWiki
- လိုင်စင်: GPL-2.0-or-later
Change the protection level of a page.
- 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). 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.
- This parameter is required.
- Separate values with | or alternative.
- Maximum number of values is ၅၀ (၅၀၀ for clients that are allowed higher limits).
- 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 | or alternative.
- Maximum number of values is ၅၀ (၅၀၀ for clients that are allowed higher limits).
- Default: infinite
- reason
Reason for (un)protecting.
- Default: (empty)
Change tags to apply to the entry in the protection log.
- Values (separate with | or alternative):
- 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
- Deprecated.
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.
- One of the following values: nochange, preferences, unwatch, watch
- Default: preferences
- watchlistexpiry
Watchlist expiry timestamp. Omit this parameter entirely to leave the current expiry unchanged.
- Type: expiry (details)
- token
A "csrf" token retrieved from action=query&meta=tokens
- This parameter is required.
- စာမျက်နှာတစ်ခုကို ကာကွယ်ပါ
- api.php?action=protect&title=%E1%80%9D%E1%80%85%E1%80%BA%E1%80%9B%E1%80%BE%E1%80%84%E1%80%BA%E1%80%94%E1%80%9B%E1%80%AE%3A%E1%80%97%E1%80%9F%E1%80%AD%E1%80%AF%E1%80%85%E1%80%AC%E1%80%99%E1%80%BB%E1%80%80%E1%80%BA%E1%80%94%E1%80%BE%E1%80%AC&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=%E1%80%9D%E1%80%85%E1%80%BA%E1%80%9B%E1%80%BE%E1%80%84%E1%80%BA%E1%80%94%E1%80%9B%E1%80%AE%3A%E1%80%97%E1%80%9F%E1%80%AD%E1%80%AF%E1%80%85%E1%80%AC%E1%80%99%E1%80%BB%E1%80%80%E1%80%BA%E1%80%94%E1%80%BE%E1%80%AC&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=%E1%80%9D%E1%80%85%E1%80%BA%E1%80%9B%E1%80%BE%E1%80%84%E1%80%BA%E1%80%94%E1%80%9B%E1%80%AE%3A%E1%80%97%E1%80%9F%E1%80%AD%E1%80%AF%E1%80%85%E1%80%AC%E1%80%99%E1%80%BB%E1%80%80%E1%80%BA%E1%80%94%E1%80%BE%E1%80%AC&token=123ABC&protections=&reason=Lifting%20restrictions [open in sandbox]