Preferences Operations Update Preferences

Preferences Operations Update Preferences
Update user preferences

Persists or merges user preferences for the authenticated user; behaves like POST. The path /api/v1/users/preferences is an alias of /api/v1/user/preferences for every method. Accessible to every authenticated role. The same rules apply: keys are free-form (1 to 256 characters), blank keys are ignored, any JSON value is accepted, an unchanged value is not rewritten, keys not named in the body are kept, and the 200 response is the complete preference set after the update.

Request
URI
PUT
https://{api_host}/api/v1/user/preferences
COPY
Request Body

A JSON object of preference keys to values. Each key is stored or replaced for the signed-in user, keys with a blank name are ignored and keys that are not listed are left unchanged.

{
    "panels.licensing.hosts": true
}
Authentication
This operation uses the following authentication methods.
Responses
200

200 OK successful response envelope. All stored preferences of the signed-in user after the update

{
    "panels.licensing.hosts": true
}

400

400 Bad Request: MALFORMED_REQUEST

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


401

401 Unauthorized: UNAUTHENTICATED when the VTP_SESSION cookie is missing, unknown, expired or revoked

Returns Unauthenticated of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


Code Samples
COPY
                    curl -X PUT -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{}' https://{api_host}/api/v1/user/preferences