Set scoped userdata

This function sets (creates or updates) a userdata key/value pair within the specified scope and returns the full updated mapping.

SecurityBasicAuth
Request
query Parameters
scope
required
string

The scope name to modify.

Example: scope=example_scope
json
string

A json string to save to the specified scope.

Note: The "json" argument cannot be used with the "key" or "value" arguments.

Example: json={"theme":"dark"}
key
string

The userdata key to set.

Note: The "json" argument cannot be used with the "key" or "value" arguments.

Example: key=theme
value
string

The value to assign to the key.

Note: The "json" argument cannot be used with the "key" or "value" arguments.

Example: value=dark
Responses
200

HTTP Request was successful.

Response Schema: application/json
object

The updated mapping of all userdata in the scope.

object
get/set_scoped_userdata
Request samples
whmapi1 --output=jsonpretty \
  set_scoped_userdata \
  scope='example_scope' \
  key='theme' \
  value='dark'
Response samples
application/json
{
  • "data": {
    • "theme": "dark",
    • "items_per_page": "50"
    },
  • "metadata": {
    • "command": "set_scoped_userdata",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}