Set scoped userdata key/value

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

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
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/UserData/set_scoped_userdata
Request samples
uapi --output=jsonpretty \
--user=username \
UserData \
set_scoped_userdata \
scope=ui_prefs \
key=theme \
value=dark
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "set_scoped_userdata",
  • "module": "UserData",
  • "result": {
    • "data": {
      • "theme": "dark",
      • "items_per_page": "50",
      • "show_help_tour": "0"
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}