For AI agents: markdown of this page — /docs-content-en/entities/deals/update.md documentation index — /llms.txt
Update deal
PATCH /v1/deals/:id
Updates the fields of an existing deal. Pass only the fields being changed. For the full list, see the field reference.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id (path) |
number | yes | Deal ID. List: GET /v1/deals |
Frequently updated fields
| Parameter | Type | Required | Description |
|---|---|---|---|
stageId |
string | no | Pipeline stage. Each pipeline has its own set of stages. List: GET /v1/statuses?filter[entityId]=DEAL_STAGE for the main pipeline, DEAL_STAGE_{categoryId} for the others |
amount |
number | no | Deal amount. To keep a manually set value, pass isManualOpportunity: true together with it |
assignedById |
number | no | Assigned person. List: GET /v1/users |
title |
string | no | Title |
closedAt |
datetime | no | Closing date |
ufCrm* |
per field schema | no | A user field of the Bitrix24 account, for example ufCrmProjectCode. The actual name and type are in the schema GET /v1/deals/fields, and the value format for each type is in User fields (UF). An enumeration field takes the option ID from the field's items array in the schema, and a multiple field takes an array of such IDs. If you send the option label VALUE instead of the ID, the value is lost: a single-value field gets 0. A number that is not among the options is stored as is. Neither the label nor a non-existent ID raises an error, and the request returns 200, so map the label to its ID on your side and check the stored value of this field in the response data |
Examples
curl — personal key
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 application
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
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 application
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 |
meta.warnings |
array | Present when the body carries fields that are neither in the deal schema nor in the field list of GET /v1/deals/fields, for example a misspelled name. The warning code is UNRECOGNIZED_WRITE_FIELD: such a field may not have been stored. The response status is 200 |
Response example
{
"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"
}
}
Error response example
404 — deal not found:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Item not found"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 404 | ENTITY_NOT_FOUND |
Deal not found |
| 422 | STAGE_NOT_APPLIED |
The stageId/categoryId you sent was not applied: after the PATCH, the value is unchanged. A possible cause is that no stage or pipeline with that ID exists. Details are in error.message and error.details. The re-read deal is in data. The record has already been updated, and other fields in the request body may have been applied: correct the value and send only what still needs changing, not the whole body again |
| 403 | BITRIX_ACCESS_DENIED |
No access to the deal |
| 400 | INVALID_PARAMS |
A field value has the wrong type or format, or the id in the path is not a non-negative integer |
| 400 | EMPTY_UPDATE_BODY |
The request body is empty: there are no fields to change |
| 400 | READONLY_FIELD |
The request body contains a read-only field, such as isWon. Such fields are marked in the RO column of Deal fields |
| 403 | SCOPE_DENIED |
API key lacks the crm scope |
| 403 | WRITE_BLOCKED_READONLY_KEY |
The key is read-only — see access rights |
| 401 | TOKEN_MISSING |
API key has no configured tokens |
Full list of common API errors — Errors.