Set Setting¶
Creates or replaces one custom setting. Boolean values are stored and returned as JSON booleans, so true and false remain booleans when read with Get Settings By Login.
PUT
https://{some_domain}/setting
Authorization¶
Include the session JWT in the Authorization header:
Authorization: <JWT_TOKEN>
The login field is required for every session. For a normal user session, the server saves the setting for the authenticated account login. For customer and staff sessions, it uses the supplied login. Manager, administrator, and dealer sessions need the access_backoffice scope and set_accounts permission; a SuperAdmin bypasses these staff scope and permission checks.
Request¶
Content-Type: application/json
Body Parameters¶
| Field | Type | Required | Description |
|---|---|---|---|
login |
integer | Yes | Account login. Required even when a normal user session's authenticated login is used. |
key |
string | Yes | Setting name. |
value |
string / number / boolean / object / array | Yes | JSON value to save. Boolean values, including false, are supported. null is not supported. |
Request Example¶
{
"login": 7777864,
"key": "themeEnabled",
"value": true
}
The same field accepts false:
{
"login": 7777864,
"key": "soundNotify",
"value": false
}
Response¶
Response Fields¶
| Field | Type | Description |
|---|---|---|
data |
string | OK when the setting is saved. |
Error Responses¶
| HTTP | Error | Description |
|---|---|---|
| 400 | INVALID_DATA |
A required field is missing or has an unsupported type; value: null is rejected. |
| 403 | INVALID_ACCESS |
The target login could not be resolved. |
| 403 | RET_NOT_ENOUGH_RIGHTS |
A manager session lacks the required scope or permission. |
| 500 | INVALID_SET_SETTING |
The setting could not be persisted. The response also contains a message field. |
Persistence error example:
{
"error": "INVALID_SET_SETTING",
"message": "Common error"
}
Success (200)¶
{
"data": "OK"
}