[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmanagement\u002Fcolor":3,"docs-tabs-chats\u002Fmanagement\u002Fcolor":6},{"content":4,"lastmod":5},"## Change a chat color\n\n`PUT \u002Fv1\u002Fchats\u002F:dialogId\u002Fcolor`\n\nSets the chat color to one of the seventeen Bitrix24 palette codes. An RGB color value is not accepted.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Dialog ID: `chatXXX` for a group chat, a numeric user ID for private messages, `me` — the current user's personal dialog. To find a CRM entity chat, use [Find a CRM entity chat](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Ffind) |\n\nThe endpoint takes no query parameters: any parameter in the query string is refused with `400 INVALID_PARAMS`.\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `color` | string | yes | A color code from the table below, in any case: `mint` and `MINT` are equivalent |\n\nOther body fields are refused with `400 INVALID_PARAMS`, and the message names the extra field.\n\nThe table lists the palette codes and the color a chat with each code returns in the `color` field of the [Dialog details](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Fget) response. A `#rrggbb` value in the request is refused.\n\n| Code | Color in the chat response |\n|-----|--------------------|\n| `RED` | `#df532d` |\n| `GREEN` | `#64a513` |\n| `MINT` | `#4ba984` |\n| `LIGHT_BLUE` | `#4ba5c3` |\n| `DARK_BLUE` | `#3e99ce` |\n| `PURPLE` | `#8474c8` |\n| `AQUA` | `#1eb4aa` |\n| `PINK` | `#f76187` |\n| `LIME` | `#58cc47` |\n| `BROWN` | `#ab7761` |\n| `AZURE` | `#29619b` |\n| `KHAKI` | `#728f7a` |\n| `SAND` | `#ba9c7b` |\n| `MARENGO` | `#556574` |\n| `GRAY` | `#909090` |\n| `GRAPHITE` | `#5e5f5e` |\n| `COPILOT` | `#8d51eb` |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X PUT https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat2741\u002Fcolor \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"color\": \"MINT\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PUT https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat2741\u002Fcolor \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"color\": \"MINT\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat2741\u002Fcolor', {\n  method: 'PUT',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ color: 'MINT' }),\n})\n\nconst { success } = await res.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat2741\u002Fcolor', {\n  method: 'PUT',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ color: 'MINT' }),\n})\n\nconst { success } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | boolean | `true` — the color is saved |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": true\n}\n```\n\n## Error response example\n\n400 — a `#rrggbb` color was sent instead of a code:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"Body field `color` must be a palette code: RED, GREEN, MINT, LIGHT_BLUE, DARK_BLUE, PURPLE, AQUA, PINK, LIME, BROWN, AZURE, KHAKI, SAND, MARENGO, GRAY, GRAPHITE, COPILOT (any case). A hex value is not accepted — the portal stores codes, and replaces any other value with a colour of its own choice.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | The body has no `color` or it is not a palette code, the body has another field, the body is not a JSON object, or the query string has a parameter. Checked before the Bitrix24 call |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 refused: the user is not a chat member, or the `ui` permission does not let them change the color |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error; the portal code is in `error.b24Code`. If the chat does not exist, the code is `CHAT_NOT_FOUND` |\n| 403 | `SCOPE_DENIED` | The API key lacks the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — changing the color counts as a write |\n| 401 | `TOKEN_MISSING` | The API key has no configured Bitrix24 tokens |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | `dialogId=me` — the current user's ID could not be resolved |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a server error |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**A value outside the palette is refused before the write.** The code `ORANGE`, a `#rrggbb` value and a mistyped code never reach Bitrix24: Bitrix24 would store a color of its own choice instead and report success. So the endpoint returns `400 INVALID_PARAMS`, and the chat color stays unchanged.\n\n**No system message.** Changing the color does not post a system message to the chat, unlike changing the [avatar](\u002Fdocs\u002Fchats\u002Fmanagement\u002Favatar).\n\n## See also\n\n- [Change a chat description](\u002Fdocs\u002Fchats\u002Fmanagement\u002Fdescription)\n- [Change a chat avatar](\u002Fdocs\u002Fchats\u002Fmanagement\u002Favatar)\n- [Set the permission to change chat appearance](\u002Fdocs\u002Fchats\u002Fmanagement\u002Fpermissions-ui)\n- [Dialog details](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Fget)\n","2026-10-05",{},1794739538904]