## Skip a dialog

`POST /v1/openlines/operator/skip`

Declines an Open Channel dialog offered to the employee: the dialog returns to the channel queue.

The action runs on behalf of the employee the key belongs to — see [On whose behalf the action runs](/docs/openlines/operator#on-whose-behalf-the-action-runs).

## Request fields (body)

| Field | Type | Required | Description |
|---|---|:---:|---|
| `chatId` | number \| string | yes | Open Channel chat identifier, a positive integer. A string is accepted if it consists of digits only and does not start with zero. See [Chat ID](/docs/openlines/operator#chat-id) |

## Examples

### curl — personal key

```bash
curl -X POST https://vibecode.bitrix24.com/v1/openlines/operator/skip \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"chatId": 5255}'
```

### curl — OAuth application

```bash
curl -X POST https://vibecode.bitrix24.com/v1/openlines/operator/skip \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"chatId": 5255}'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/openlines/operator/skip', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ chatId: 5255 }),
})

const body = await res.json()
if (!body.success) throw new Error(`${body.error.code}: ${body.error.message}`)
console.log('Dialog skipped:', body.data.chatId)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/openlines/operator/skip', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ chatId: 5255 }),
})

const body = await res.json()
if (!body.success) throw new Error(`${body.error.code}: ${body.error.message}`)
console.log('Dialog skipped:', body.data.chatId)
```

## Response fields

| Field | Type | Description |
|---|---|---|
| `success` | boolean | `true` |
| `data.chatId` | number | Chat identifier from the request. A string from the request is returned as a number |
| `data.skipped` | boolean | Always `true` |

## Response example

```json
{
  "success": true,
  "data": {
    "chatId": 5255,
    "skipped": true
  }
}
```

## Error response example

404 — no chat with this identifier:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Open Line chat not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|---|---|---|
| 400 | `INVALID_CHAT_ID` | `chatId` is missing, is not a positive integer, is a string with non-digit characters or a leading zero, or is greater than 9007199254740991 |
| 404 | `ENTITY_NOT_FOUND` | No chat with this `chatId` |
| 422 | `BITRIX_ERROR` | The dialog has already been accepted by an operator — the employee the call runs as or another employee. `error.message` is `Bitrix24 API error: 400`, and there is no `error.b24Code` field. To hand an accepted dialog to a colleague or to the queue, use [`POST /v1/openlines/operator/transfer`](/docs/openlines/operator/transfer) |
| 422 | `BITRIX_ERROR` | The chat has no open session: the dialog is already finished. `error.b24Code` is `ACCESS_DENIED_KICK`, and `error.message` is in the portal language |
| 403 | `BITRIX_ACCESS_DENIED` | The employee the call runs as has no permission for the action |
| 502 | `OPENLINE_OPERATOR_FAILED` | Bitrix24 responded without an error but did not confirm the action |
| 403 | `SCOPE_DENIED` | The key has no `imopenlines` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `INVALID_API_KEY` | The key is not recognized |
| 401 | `TOKEN_MISSING` | A personal key has no access to the Bitrix24 portal, or an application key was sent without a session token in `Authorization` |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or the connection to it broke before the response was complete |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [Operator actions and my pause](/docs/openlines/operator)
- [Transfer a dialog](/docs/openlines/operator/transfer)
- [Session search](/docs/openlines/sessions/search)
- [Open Channels](/docs/openlines)
