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=options

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

Change preferences of the current user.

Only options which are registered in core or in one of installed extensions, or options with keys prefixed with userjs- (intended to be used by user scripts), can be set.

Specific parameters:
Other general parameters are available.
reset

Resets preferences to the site defaults.

Type: boolean (details)
resetkinds

List of types of options to reset when the reset option is set.

Values (separate with | or alternative): all, registered, registered-checkmatrix, registered-multiselect, special, unused, userjs
Default: all
change

List of changes, formatted name=value (e.g. skin=vector). If no value is given (not even an equals sign), e.g., optionname|otheroption|..., the option will be reset to its default value. If any value passed contains the pipe character (|), use the alternative multiple-value separator for correct operation.

Separate values with | or alternative.
Maximum number of values is 50 (500 for clients that are allowed higher limits).
optionname

The name of the option that should be set to the value given by optionvalue.

optionvalue

The value for the option specified by optionname. When optionname is set but optionvalue is omitted, the option will be reset to its default value.

global

What to do if the option was set globally using the GlobalPreferences extension.

  • ignore: Do nothing. The option remains with its previous value.
  • override: Add a local override.
  • update: Update the option globally.
One of the following values: ignore, override, update
Default: ignore
token

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

This parameter is required.
Examples:
Reset all preferences.
[open in sandbox]
Change skin and hideminor preferences.
[open in sandbox]
Reset all preferences, then set skin and nickname.
[open in sandbox]