## List Open Channels for a form

`GET /v1/crm-forms/:id/openlines`

Returns the Open Channels in the Bitrix24 account and their association with the selected CRM form.

## Parameters

| Parameter | Type | Required | Default | Description |
|-----------|-----|--------|-----------|-------------|
| `id` (path) | number | yes | — | Positive integer form ID. Source: [List CRM forms](/docs/entities/crm-forms/list) |
| `limit` (query) | number | no | Bitrix24 default | Requested page size. Bitrix24 validates the value |
| `offset` (query) | number | no | Bitrix24 default | Requested offset. Bitrix24 validates the value |
| `order` / `sort` (query) | object / string | no | Bitrix24 default | Sort by ID: `order[id]=desc` or `sort=-id` |

Pagination: each request retrieves one page. Omit `limit` and `offset` to use the Bitrix24 defaults. Either parameter can be sent separately. Pages are not fetched automatically. `select` is not supported.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/crm-forms/91/openlines?sort=-id" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/crm-forms/91/openlines?sort=-id" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-forms/91/openlines?sort=-id', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data, meta } = await res.json()
console.log(data)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-forms/91/openlines?sort=-id', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data, meta } = await res.json()
console.log(data)
```

## Response fields

| Field | Type | Description |
|------|-----|-------------|
| `success` | boolean | Always `true` on success |
| `data` | array | Array of Open Channels |
| `data[].formId` | number | Requested form ID. Source: [List CRM forms](/docs/entities/crm-forms/list) |
| `data[].id` | number | Open Channel ID from this list |
| `data[].name` | string | Name as returned by Bitrix24. Only credentials of the current connection are replaced, with paths listed in `meta.redacted` |
| `data[].bound` | boolean | Whether the item is associated with the requested form |
| `data[].welcomeFormEnabled` | boolean | Whether the welcome form is enabled |
| `data[].welcomeFormId` | number \| null | Welcome form ID. `null` when there is no welcome form. Source: [List CRM forms](/docs/entities/crm-forms/list) |
| `data[].welcomeFormDelayed` | boolean | Whether the welcome form is shown with a delay |
| `data[].previewUrl` | string \| null | Public preview URL, returned unchanged. `null` when no preview is available |
| `meta.limit` | number | Page size when supplied in the Bitrix24 response |
| `meta.offset` | number | Offset when supplied in the Bitrix24 response |
| `meta.total` | number | Total record count. Omitted when the source does not supply a count |
| `meta.redacted` | string[] | Paths where current connection credentials were replaced |

## Response example

The first two items are shown. Public domains and signatures are placeholders.

```json
{
  "success": true,
  "data": [
    {
      "formId": 91,
      "id": 59,
      "name": "Support",
      "bound": false,
      "welcomeFormEnabled": true,
      "welcomeFormId": 25,
      "welcomeFormDelayed": true,
      "previewUrl": null
    },
    {
      "formId": 91,
      "id": 45,
      "name": "Sales",
      "bound": false,
      "welcomeFormEnabled": true,
      "welcomeFormId": 25,
      "welcomeFormDelayed": true,
      "previewUrl": null
    }
  ]
}
```

## Error response example

400 — the form ID is not a positive integer:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "id must be a positive safe integer"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|-------------|
| 400 | `INVALID_PARAMS` | The form `id` is not a positive integer |
| 400 | `INVALID_PARAMS` | Unknown query parameter, or an invalid `order` or `sort` structure |
| 400 | `INVALID_PARAMS` | Both `order[...]` and `sort` were supplied |
| 400 | `INVALID_PARAMS` | Bitrix24 rejected the sorting or the pagination, for example a non-numeric `limit` or `offset`. The original code is in `error.b24Code` and field diagnostics are in `error.validation` |
| 401 | `TOKEN_MISSING` | Bitrix24 credentials are missing or no OAuth session was provided |
| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope |
| 403 | `BITRIX_ACCESS_DENIED` | The Bitrix24 user lacks read permission |
| 409 | `CRM_FORM_REST_NOT_ENABLED` | CRM form REST methods are disabled on the Bitrix24 account. The original code for the missing method is in `error.b24Code` |
| 403 | `BITRIX_INSUFFICIENT_SCOPE` | The Bitrix24 token lacks the required scope. The original code is in `error.b24Code` |
| 404 | `ENTITY_NOT_FOUND` | Form not found |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request |
| 429 | `RATE_LIMITED` | Rate limit exceeded. Retry after the interval in `Retry-After` |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned an invalid response |
| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond within the time limit. Retry the read after the interval in `Retry-After` |

Errors from Bitrix24 include the original `error.b24Code` and field diagnostics in `error.validation`, when supplied. For common API errors, see [Errors](/docs/errors).

## Known specifics

The list includes all Open Channels in the Bitrix24 account, including items with `bound: false`. To select items associated with the form, keep entries with `bound: true` in the response array. A `bound` query parameter is not supported.

Requires the `crm` scope. Keys in `READONLY` mode can use this endpoint. Reading does not change item settings.

## See also

- [List CRM forms](/docs/entities/crm-forms/list)
- [Form embedding](/docs/entities/crm-forms/embedding)
- [CRM forms](/docs/entities/crm-forms)
