
## Get pipeline

`GET /v1/categories/:entityTypeId/:id`

Returns a single pipeline by ID within the specified CRM entity type.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `entityTypeId` (path) | number | yes | CRM entity type ID. Deals — `2`, contacts — `3`, companies — `4`, invoices — `31`, smart processes — from [`GET /v1/smart-processes`](/docs/entities/smart-processes/list) |
| `id` (path) | number | yes | Pipeline ID. List: [`GET /v1/categories/:entityTypeId`](/docs/entities/categories/list) |
| `select` (query) | string | no | Comma-separated response fields, for example `id,name`. Without the parameter, all fields are returned. The `id` field is always returned. Names come from [Pipeline fields](/docs/entities/categories/fields) |

## Examples

In the examples, `entityTypeId = 2`, `id = 1` — replace with your values.

### curl — personal key

```bash
curl -X GET https://vibecode.bitrix24.com/v1/categories/2/1 \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X GET https://vibecode.bitrix24.com/v1/categories/2/1 \
  -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/categories/2/1', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { success, data } = await res.json()
console.log('Pipeline:', data.name)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/categories/2/1', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | object | Pipeline object |
| `data.id` | number | Pipeline ID. For deals the main pipeline has ID `0` |
| `data.name` | string | Pipeline name |
| `data.sort` | number | Sort order |
| `data.entityTypeId` | number | CRM entity type ID, mirrors the path parameter |
| `data.isDefault` | boolean | Marks the main pipeline of the type |
| `data.originId` | string \| null | External identifier. `null` for pipelines with no external binding. Deal pipelines only |
| `data.originatorId` | string \| null | Source of the external binding. `null` for pipelines with none. Deal pipelines only |
| `data.isSystem` | string | System pipeline: `Y` — created by Bitrix24, `N` — created by a user. Contact and company pipelines only. |
| `data.code` | string \| null | Symbolic code of a system pipeline, for example `CATALOG_CONTRACTOR_CONTACT`. `null` for the main pipeline and for user-created ones. Contact and company pipelines only |
| `meta.warnings` | array | Returned when `select` lists a name that is absent from the pipeline schema, or the `createdDate` field, which Bitrix24 does not return. The request still runs: a field with an unknown name comes back if the pipeline has it, and is absent otherwise. Each warning is an object with `code`, `field` and `message`, and the code is `UNKNOWN_SELECT_FIELD` |

The field set depends on the entity type. Deal pipelines return `originId` and `originatorId`, except for the main pipeline (id `0`). Contact (`3`) and company (`4`) pipelines return `isSystem` and `code`. Invoice and smart process pipelines return only the common fields. The `createdDate` field from the [pipeline schema](/docs/entities/categories/fields) is not returned for any type, even when listed in `select`.

For deals (`entityTypeId = 2`), get the stages of the main pipeline (`id = 0`) from `GET /v1/statuses?filter[entityId]=DEAL_STAGE` and the stages of an additional pipeline (`id = N`) from `GET /v1/statuses?filter[entityId]=DEAL_STAGE_{id}` (for example, `id = 1` → `DEAL_STAGE_1`). This deal-stage directory naming rule does not apply to invoices or smart processes.

## Response example

```json
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Newest",
    "sort": 100,
    "entityTypeId": 2,
    "isDefault": false,
    "originId": null,
    "originatorId": null
  }
}
```

The main deal pipeline (id `0`) comes without `originId` and `originatorId`:

```json
{
  "success": true,
  "data": {
    "id": 0,
    "name": "General",
    "sort": 300,
    "entityTypeId": 2,
    "isDefault": true
  }
}
```

A contact or company pipeline comes back with `isSystem` and `code`:

```json
{
  "success": true,
  "data": {
    "id": 15,
    "name": "Vendor contacts",
    "sort": 500,
    "entityTypeId": 3,
    "isDefault": false,
    "isSystem": "Y",
    "code": "CATALOG_CONTRACTOR_CONTACT"
  }
}
```

## Error response example

404 — pipeline not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Item not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | No pipeline with the given `id` in this type |
| 404 | `ENTITY_NOT_FOUND` | `entityTypeId` does not match an existing CRM type |
| 422 | `BITRIX_ERROR` | The CRM type does not support pipelines. Quotes (type `7`) have no pipelines |
| 403 | `SCOPE_DENIED` | The API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## See also

- [List pipelines](/docs/entities/categories/list)
- [Update pipeline](/docs/entities/categories/update)
- [Pipeline fields](/docs/entities/categories/fields)
- [Smart process types](/docs/entities/smart-processes)
- [Stages and statuses](/docs/entities/statuses)
- [Entity API](/docs/entity-api)
