[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fcopilot\u002Fvote":3,"docs-tabs-chats\u002Fcopilot\u002Fvote":6},{"content":4,"lastmod":5},"\n## Rate an answer\n\n`POST \u002Fv1\u002Fchats\u002Fmessages\u002F:messageId\u002Fvote`\n\nRates a message with \"like\" or \"dislike\". Meant for rating CoPilot answers.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `messageId` (path) | number | yes | Message ID. Get it from `data.messages[].id` of the [draft chat](\u002Fdocs\u002Fchats\u002Fcopilot\u002Fdraft) or of the [message history in the v2 mode](\u002Fdocs\u002Fchats\u002Fmessages\u002Flist) |\n\nQuery parameters are not accepted and are rejected with `400 INVALID_PARAMS`.\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `value` | string | yes | The rating: `like` or `dislike` |\n\nOther body fields are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F9002\u002Fvote \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"value\": \"like\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F9002\u002Fvote \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"value\": \"like\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F9002\u002Fvote', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ value: 'like' }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Rating sent:', data.result)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F9002\u002Fvote', {\n  method: 'POST',\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({ value: 'like' }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Rating sent:', data.result)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.result` | boolean | `true` — the rating was sent |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"result\": true\n  }\n}\n```\n\n## Error response example\n\n400 — an invalid `value`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"`value` must be `like` or `dislike`.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `messageId` is not a positive integer, `value` is missing or is neither `like` nor `dislike`, or another body field or a query parameter was sent. Checked before any call to Bitrix24 |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 returned \"not found\". The portal code is in `error.b24Code` |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error. The portal code is in `error.b24Code` |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — the call may make the key owner a chat member |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**The call may make you a member.** If the message's chat allows auto-join — for example, a comment chat, a collab or a task chat — the call adds the current user as a member, just as opening the chat in the Bitrix24 interface does. The call therefore counts as a write.\n\n**Rating any message.** The endpoint accepts a rating for any message and returns `result: true`. Only ratings of CoPilot answers in a CoPilot chat are taken into account. This endpoint cannot read a rating back.\n\n## See also\n\n- [CoPilot](\u002Fdocs\u002Fchats\u002Fcopilot)\n- [Regenerate a CoPilot answer](\u002Fdocs\u002Fchats\u002Fcopilot\u002Fregenerate)\n- [CoPilot draft chat](\u002Fdocs\u002Fchats\u002Fcopilot\u002Fdraft)\n","2026-10-07",{},1794739533833]