API:Options

POST Request to change preferences of the current user.

Example
Making any POST request is a multi-step process:   Log in, via one of the methods described on . GET a Manual:Edit token.  Send a POST request, with the CSRF token, to take action on a page. 

The sample code below covers the final step in detail.

POST Request
Note: In this example, all parameters are passed in a GET request for the sake of simplicity. However, action=options requires POST requests; GET requests will cause an error.

Sample code
change_user_options.py

Available Options
Note: The following is an example list obtained with  for a Wikipedia (MW 1.24) account. Most of the options listed here are defined by various MediaWiki extensions, like Echo, VisualEditor, WikiLove, Gadgets or EducationProgram, among others.
 * : 0
 * : 80
 * : "mdy"
 * : 0
 * : 0
 * : "default"
 * : 0
 * : 0
 * : 0
 * : 0
 * : 1
 * : 0
 * : "1"
 * : "1"
 * : "1"
 * : "male"
 * : 0
 * : 0
 * : 2
 * : 0
 * : 0
 * : 0
 * : user signature
 * : 0
 * : 0
 * : 0
 * : 1
 * : "14"
 * : "100"
 * : 25
 * : false
 * : 1
 * : 1
 * : "vector"
 * : 0
 * : "3"
 * : 2
 * : 0
 * : 0
 * : 1
 * : "1"
 * : 0
 * : "2"
 * : 0
 * : 0
 * : 0
 * : 0
 * : 0
 * : 0
 * : "1"
 * : "300"
 * : 1
 * : 1
 * : 1
 * : 0
 * : true
 * : false
 * : 1
 * : 1
 * : true
 * : 0
 * : 0
 * : 0
 * : 0
 * : 0
 * : 1
 * : false
 * : true
 * : false
 * : false
 * : false
 * : true
 * : true
 * : true
 * : false
 * : true
 * : true
 * : 0
 * : "html"
 * : true
 * : true
 * : true
 * : true
 * : false
 * : true
 * : 1
 * : true
 * : false
 * : true
 * : false
 * : false
 * : false
 * : true
 * : true
 * : false
 * : true
 * : false
 * : true
 * : "en"
 * : "gan"
 * : "iu"
 * : "kk"
 * : "ku"
 * : "shi"
 * : "sr"
 * : "tg"
 * : "uz"
 * : "zh"
 * : true
 * : false
 * : "1"
 * : false
 * : "1"
 * : false
 * : "1"
 * : false
 * : "1"
 * : false
 * : "1"
 * : false
 * : "1"
 * : false
 * : "1"
 * : false
 * : false
 * : false
 * : false
 * : false
 * : false
 * : false
 * : false
 * : false
 * : false
 * : false
 * : false
 * : false
 * : 1
 * : 1
 * : 1
 * : 1
 * : 1
 * : "0"
 * : "0"
 * : timestamp
 * : "0"
 * : "ZoneInfo|60|Europe/London"
 * : "0"
 * : "1"
 * : arbitrary value
 * : token
 * : arbitrary value
 * : token

Possible errors
In addition to :

Parameter history

 * 1.21: Introduced

Additional notes

 * This API is primarily intended for changing options which are registered by MediaWiki core or extensions and available on Special:Preferences.
 * You can also use the API to set arbitrary user options that can be used by user scripts or external editors. These options must begin with the prefix.
 * There are currently no limit on the number of user options you can set at once. You can store data within a user option by encoding it as a  string.
 * Providing only names of options without equal sign results in resetting them (e.g. ). In the case of an arbitrary   key/value pair, the resetting results in its deletion.
 * The  parameter cannot be used to set a value which contains a pipe character , as it is used by the API to separate options. If you need to set such a value (e.g., a user signature) use an   &   pair.
 * The following limits apply to all user options:
 * The byte length of the key must be <= 255.
 * The byte length of the value must be <= 65535.
 * The key must consist only of ASCII letters, numbers, hyphens and underscores (a-z, A-Z, 0-9, _, -).