updateUserPreferences
Requires an authenticated session.
Saves the signed-in user's own preferences: language, currency, region, time zone and date, time and number formats. Available to customer apps too.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation UpdateUserPreferences($input: UpdateUserPreferencesInput!) {
updateUserPreferences(input: $input) {
id
createdAt
currencyId
dateFormat
languageId
numberFormat
language {
id
code
name
nativeName
createdAt
direction
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation UpdateUserPreferences($input: UpdateUserPreferencesInput!) {\n updateUserPreferences(input: $input) {\n id\n createdAt\n currencyId\n dateFormat\n languageId\n numberFormat\n language {\n id\n code\n name\n nativeName\n createdAt\n direction\n }\n }\n}",
"variables": {
"input": {}
}
}
EOF
Variables:
{
"input": {}
}
Response:
{
"data": {
"updateUserPreferences": {
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"currencyId": "string",
"dateFormat": "string",
"languageId": "string",
"numberFormat": "string",
"language": {
"id": "id",
"code": "string",
"name": "string",
"nativeName": "string",
"createdAt": "2025-01-15T00:00:00Z",
"direction": "LTR"
}
}
}
}
updateUserPreferences(
input: UpdateUserPreferencesInput!
): UserPreference!
Arguments
updateUserPreferences.input ● UpdateUserPreferencesInput! non-null input
The preferences to save.
Type
UserPreference object
A user's preferences.