
## Update a pipeline

`PATCH /v1/deal-categories/:id`

Updates the fields of a sales pipeline by ID.

## Path parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Pipeline ID. List: [`GET /v1/deal-categories`](/docs/entities/deal-categories/list) |

## Request body parameters

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

## Examples

### curl — personal key

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

### curl — OAuth application

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

### JavaScript — personal key

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

### JavaScript — OAuth application

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | object | The pipeline with all fields after the update |
| `data.id` | number | Pipeline ID |
| `data.name` | string | Name |
| `data.sort` | number | Sort order |
| `data.isLocked` | boolean | Whether the pipeline is locked — unavailable on the current plan |
| `data.createdAt` | datetime | Creation date |

## Response example

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


## Error response example

404 — no pipeline with this ID:

```json
{
  "success": false,
  "error": { "code": "ENTITY_NOT_FOUND", "message": "Not found." }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | Pipeline not found |
| 403 | `SCOPE_DENIED` | The API key lacks the `crm` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |

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

## See also

- [Get a pipeline](/docs/entities/deal-categories/get)
- [Field reference](/docs/entities/deal-categories/fields)
- [Sales pipelines](/docs/entities/deal-categories)
