
## Update deal

`PATCH /v1/deals/:id`

Updates the fields of an existing deal. Pass only the fields being changed. Full list in the [field reference](/docs/entities/deals/fields), including user fields (`ufCrm_*`).

## Frequently updated fields

| Parameter | Type | Description |
|----------|-----|---------|
| `stageId` | string | Pipeline stage. List: `GET /v1/statuses?filter[entityId]=DEAL_STAGE` |
| `amount` | number | Deal amount |
| `assignedById` | number | Assigned person. List: `GET /v1/users` |
| `title` | string | Title |
| `closedAt` | datetime | Closing date |

## Examples

### curl — personal key

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/deals/741" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stageId": "WON",
    "amount": 75000
  }'
```

### curl — OAuth app

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/deals/741" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "stageId": "WON",
    "amount": 75000
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/deals/741', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    stageId: 'WON',
    amount: 75000,
  }),
})

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

### JavaScript — OAuth app

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/deals/741', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    stageId: 'WON',
    amount: 75000,
  }),
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `data` | object | The updated deal object with all fields — see [Fields](/docs/entities/deals/fields) |

The updated deal object with all fields — see [Deal fields](/docs/entities/deals/fields).

## Response example

```json
{
  "success": true,
  "data": {
    "id": 741,
    "title": "Equipment delivery",
    "amount": 75000,
    "currency": "USD",
    "stageId": "WON",
    "categoryId": 0,
    "assignedById": 1,
    "updatedAt": "2026-04-14T09:15:00.000Z",
    "entityTypeId": 2
  }
}
```

## Error response example

404 — deal not found:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | Deal not found |
| 403 | `ACCESS_DENIED` | No access to the deal |
| 400 | `INVALID_REQUEST` | Invalid fields |
| 403 | `SCOPE_DENIED` | API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | API key has no configured tokens |

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

## See also

- [Working with files in CRM fields](/docs/recipes/crm-files)
- [Get deal](/docs/entities/deals/get)
- [Deal fields](/docs/entities/deals/fields)
- [Batch](/docs/batch)
- [Limits and optimization](/docs/optimization)
