Preferences Operations Set Preferences

Preferences Operations Set Preferences
Save or update user preferences

Persists or merges user preferences for the authenticated user. Accessible to every authenticated role. The path /api/v1/users/preferences is an alias of /api/v1/user/preferences for every method. Preference keys are free-form (no allow-list; 1 to 256 characters, the console itself uses names such as tabs., panels. and dashboard.layout.v1); keys that are blank are ignored, any JSON value is accepted for a key, and a value equal to the stored one is not rewritten. Keys not named in the body are kept. The 200 response is the complete preference set of the user after the update.

Request
URI
POST
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.

{
    "table.hypervisors.columns": {
        "order": [
            "name",
            "status"
        ],
        "visibility": {
            "name": true,
            "status": 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,
    "table.hypervisors.columns": {
        "order": [
            "name",
            "status"
        ],
        "visibility": {
            "name": true,
            "status": true
        }
    }
}

400

400 Bad Request: MALFORMED_REQUEST when the body cannot be read as a JSON object

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 POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{}' https://{api_host}/api/v1/user/preferences