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¶
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.
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 |
|---|---|---|---|
|
string |
No |
Account display language tag. Supported values: |
|
string |
No |
Account time zone as a valid IANA time zone name, such as |
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 |
|---|---|---|
|
string |
Always |
|
object |
Updated preferences for the current account. |
|
string |
Effective account display language tag after the update: |
|
string |
Effective account IANA time zone name after the update, such as |
|
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 |
|---|---|---|
|
string |
Error code, such as |
|
string |
Error message text. |