⧼api-help-title⧽
action=protect
(main | protect)
- ⧼api-help-flag-readrights⧽
- ⧼api-help-flag-writerights⧽
- ⧼api-help-flag-mustbeposted⧽
- ⧼api-help-source⧽
- ⧼api-help-license⧽
- title
- ⧼apihelp-protect-param-title⧽
- pageid
- ⧼apihelp-protect-param-pageid⧽
- Type: integer
- protections
- ⧼apihelp-protect-param-protections⧽
- This parameter is required.
- Separate values with "|", or prefix the list with U+001F and separate with U+001F.
- Maximum number of values is 50 (500 for clients that are allowed higher limits).
- expiry
- ⧼apihelp-protect-param-expiry⧽
- Separate values with "|", or prefix the list with U+001F and separate with U+001F.
- Maximum number of values is 50 (500 for clients that are allowed higher limits).
- Default: infinite
- reason
- ⧼apihelp-protect-param-reason⧽
- Default: (empty)
- tags
- ⧼apihelp-protect-param-tags⧽
- Values (separate with U+007C (pipe), or prefix the list with U+001F and separate with U+001F):
- cascade
- ⧼apihelp-protect-param-cascade⧽
- Type: boolean
- watch
- ⧼api-help-param-deprecated⧽
- ⧼apihelp-protect-param-watch⧽
- Type: boolean
- watchlist
- ⧼apihelp-protect-param-watchlist⧽
- One of the following values: nochange, preferences, unwatch, watch
- Default: preferences
- token
- ⧼api-help-param-token⧽
- This parameter is required.
- ⧼apihelp-protect-example-protect⧽
- api.php?action=protect&title=Main%20Page&token=123ABC&protections=edit=sysop|move=sysop&cascade=&expiry=20070901163000|never ⧼api-help-open-in-apisandbox⧽
- ⧼apihelp-protect-example-unprotect⧽
- api.php?action=protect&title=Main%20Page&token=123ABC&protections=edit=all|move=all&reason=Lifting%20restrictions ⧼api-help-open-in-apisandbox⧽
- ⧼apihelp-protect-example-unprotect2⧽
- api.php?action=protect&title=Main%20Page&token=123ABC&protections=&reason=Lifting%20restrictions ⧼api-help-open-in-apisandbox⧽