[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-calls\u002Flog\u002Fchat":3,"docs-tabs-calls\u002Flog\u002Fchat":6},{"content":4,"lastmod":5},"## Chat with a user\n\n`GET \u002Fv1\u002Fcalls\u002Flog\u002Fchat`\n\nReturns the ID of the key owner's private chat with an employee. If the chat does not exist yet, the call creates it.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|-------|----------|\n| `userId` (query) | integer | yes | Employee ID. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist). In the call journal, take the `callData.userId` field from the [call journal list](\u002Fdocs\u002Fcalls\u002Flog\u002Flist) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X GET \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalls\u002Flog\u002Fchat?userId=77\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X GET \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalls\u002Flog\u002Fchat?userId=77\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst response = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalls\u002Flog\u002Fchat?userId=77', {\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\nconst { success, data, error } = await response.json()\nconsole.log(success ? data.chatId : error.code)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst response = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalls\u002Flog\u002Fchat?userId=77', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\nconst { success, data, error } = await response.json()\nconsole.log(success ? data.chatId : error.code)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` on success |\n| `data.chatId` | integer | ID of the private chat with the employee |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"chatId\": 253\n  }\n}\n```\n\n## Error response example\n\n400 — `userId` is missing or not a positive integer:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"userId must be a positive integer\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `userId` is missing or not a positive integer |\n| 422 | `BITRIX_ERROR` | Bitrix24 did not return a chat: `Bitrix24 did not return a chat` |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — see [access rights](\u002Fdocs\u002Faccess-rights) |\n| 403 | `SCOPE_DENIED` | The key lacks the `call` scope |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens configured |\n| 429 | `RATE_LIMITED` | The Bitrix24 request limit is exceeded |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable |\n| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**`GET` requires a key with write access.** The call can create a chat, so a read-only key gets `403 WRITE_BLOCKED_READONLY_KEY` before Bitrix24 is called, even though the method is `GET`.\n\n## See also\n\n- [Call journal](\u002Fdocs\u002Fcalls\u002Flog)\n- [List call journal](\u002Fdocs\u002Fcalls\u002Flog\u002Flist)\n- [Delete journal entry](\u002Fdocs\u002Fcalls\u002Flog\u002Fdelete)\n","2026-10-16",{},1795415350342]