
## Create a pipeline

`POST /v1/deal-categories`

Creates a new sales pipeline. After creation, add stages via [reference data](/docs/entities/statuses) with `entityId = DEAL_STAGE_{id}`.

## Request body parameters

| Parameter | Type | Required | Description |
|----------|-----|:-------:|---------|
| `name` | string | yes | Pipeline name |
| `sort` | number | | Sort order |

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/deal-categories" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Corporate sales", "sort": 200}'
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/deal-categories" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Corporate sales", "sort": 200}'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/deal-categories', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'Corporate sales', sort: 200 }),
})
const { success, data } = await res.json()
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/deal-categories', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'Corporate sales', sort: 200 }),
})
const { success, data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `id` | number | Pipeline ID |
| `name` | string | Name |
| `sort` | number | Sort |
| `isLocked` | boolean | Whether the pipeline is locked — unavailable on the current plan |
| `createdAt` | datetime | Creation date |

## Response example

```json
{
  "success": true,
  "data": {
    "id": 5,
    "createdAt": "2026-06-01T10:00:00.000Z",
    "name": "Wholesale sales",
    "sort": 200,
    "isLocked": false
  }
}
```


## Error response example

```json
{
  "success": false,
  "error": { "code": "BITRIX_ERROR", "message": "NAME is required" }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `BITRIX_ERROR` | Bitrix24 error |
| 403 | `SCOPE_DENIED` | The API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | No API key provided |

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

## See also

- [CRM reference data](/docs/entities/statuses) — creating stages for a new pipeline
- [Field reference](/docs/entities/deal-categories/fields) — all available fields
- [Sales pipelines](/docs/entities/deal-categories) — entity overview
