# Chat with a user

May create a private chat. Even GET requires a writable key; READONLY receives 403 before Bitrix24. userId is an employee ID from GET /v1/users.

`GET /v1/calls/log/chat?userId=77`

**Bitrix24:** `call.CallLog.getChat` | **Scope:** `call` | **Auth:** `X-Api-Key`

## Response fields

`data.chatId`

```json
{
  "success": true,
  "data": {
    "chatId": 4093
  }
}
```

## Examples

```bash
curl -X GET "https://vibecode.bitrix24.com/v1/calls/log/chat?userId=77" -H "X-Api-Key: vibe_api_DUMMY_personal"
```

```bash
curl -X GET "https://vibecode.bitrix24.com/v1/calls/log/chat?userId=77" -H "X-Api-Key: vibe_app_DUMMY_oauth" -H "Authorization: Bearer DUMMY_SESSION"
```

```javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/calls/log/chat?userId=77", {
  method: "GET", headers: { "X-Api-Key": "vibe_api_DUMMY_personal" }
});
const result = await response.json();
```

```javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/calls/log/chat?userId=77", {
  method: "GET", headers: { "X-Api-Key": "vibe_app_DUMMY_oauth", "Authorization": "Bearer DUMMY_SESSION" }
});
const result = await response.json();
```

## Errors

| HTTP | Code | Meaning |
|---|---|---|
| 400 | INVALID_PARAMS | Invalid input; no Bitrix24 call |
| 401 | TOKEN_MISSING / INVALID_API_KEY | Missing tokens or unusable key |
| 403 | SCOPE_DENIED / BITRIX_ACCESS_DENIED / WRITE_BLOCKED_READONLY_KEY | Missing scope, portal permission refusal, or forbidden write |
| 422 | BITRIX_ERROR | Portal business refusal or unsuccessful operation |
| 429 | BITRIX_RATE_LIMIT | Portal rate limit |
| 502 / 503 | BITRIX_ERROR | Invalid response, unavailable portal or timeout |

400: invalid input.

```json
{"success":false,"error":{"code":"INVALID_PARAMS","message":"Invalid parameter"}}
```

## See also

- [Calls](/docs/calls)
- [Feed](/docs/feed)
- [Errors](/docs/errors)
