Update account preferences

Partially update the display language or IANA time zone preference of the authenticated account and return the updated preference snapshot. Omitted fields remain unchanged.

PATCH https://api.moi.matrixorigin.cn/v5/auth/preferences

Before you begin

  1. Prepare a personal access token or service account access token for the current account; see Access credentials. This endpoint updates preferences for the current account directly and does not require a workspace ID.

  2. To inspect the current language and time zone before making changes, call Get account preferences.

Request body

Replace $AI_STUDIO_API_KEY with your credential. Authenticate with X-API-Key, Authorization: Bearer, or a browser session (which also requires X-CSRF-Token); credential types are mutually exclusive in a single request, and X-Workspace-ID is not required.

curl -X PATCH "https://api.moi.matrixorigin.cn/v5/auth/preferences" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "locale": "zh-CN",
    "timezone": "Asia/Shanghai"
  }'

Parameter

Type

Required

Description

locale

string

No

Account display language tag. Supported values: zh-CN, en-US, fr-FR, es-ES, ar, id-ID. Omitting this field keeps the current language.

timezone

string

No

Account time zone as a valid IANA time zone name, such as Asia/Shanghai, UTC, or America/New_York. Fixed offsets such as +08:00, UTC+08:00, and GMT+08:00 are rejected. Omitting this field keeps the current time zone.

The request body is limited to 1 MiB (1048576 bytes), and at least one of locale or timezone must be provided. An empty JSON object {}, unknown JSON fields, trailing JSON tokens after the first object, or unsupported locale or timezone values return HTTP 400 (ErrParamInvalid).

Successful response

Returns HTTP 200 with Cache-Control: no-store. The top-level response object contains only code and data, with no msg field.

{
  "code": "OK",
  "data": {
    "locale": "zh-CN",
    "timezone": "Asia/Shanghai",
    "updated_at": "2026-10-14T08:05:00Z"
  }
}

Field

Type

Description

code

string

Always OK when the request succeeds.

data

object

Updated preferences for the current account.

data.locale

string

Effective account display language tag after the update: zh-CN, en-US, fr-FR, es-ES, ar, or id-ID.

data.timezone

string

Effective account IANA time zone name after the update, such as Asia/Shanghai or UTC.

data.updated_at

string

Last preference update timestamp in RFC 3339 format.

Error response

An empty JSON object {}, unknown fields, trailing JSON tokens, payloads exceeding 1 MiB, or unsupported locale or timezone values return HTTP 400 (ErrParamInvalid). Sending multiple authentication credentials in one request returns HTTP 400 (ErrMultipleAuthCredentials). Missing or invalid credentials return HTTP 401 (Unauthorized or unauthenticated), browser-session requests without a valid X-CSRF-Token return HTTP 403 (ErrForbidden), and upstream preference service failures return HTTP 502 (ErrServiceUnavailable). Error responses contain only code and msg, with no data field.

{
  "code": "ErrParamInvalid",
  "msg": "Bad Request"
}

Field

Type

Description

code

string

Error code, such as ErrParamInvalid, ErrMultipleAuthCredentials, Unauthorized, unauthenticated, ErrForbidden, or ErrServiceUnavailable.

msg

string

Error message text.

Last updated on