
## Update a quote

`PATCH /v1/quotes/:id`

Updates fields of an existing CRM quote. Pass only the fields you want to change — the rest stay as they are.

## Parameters

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

## Request fields (body)

All fields are optional. Frequently changed: `stageId`, `amount` together with `isManualOpportunity`, `assignedById`, `closeDate`.

| Field | Type | Description |
|------|-----|---------|
| `title` | string | Title |
| `quoteNumber` | string | Quote number |
| `stageId` | string | Status: `DRAFT`, `SENT`, `APPROVED`. List: `GET /v1/statuses?filter[entityId]=QUOTE_STATUS` |
| `amount` | number | Quote amount. Pass it together with `isManualOpportunity: true` — without this flag the amount is recalculated from the product rows |
| `isManualOpportunity` | boolean | `true` — manual amount mode |
| `currency` | string | Currency. List: `GET /v1/currencies` |
| `dealId` | number | Deal ID. List: `GET /v1/deals` |
| `leadId` | number | Lead ID. List: `GET /v1/leads` |
| `contactId` | number | Primary contact ID. List: `GET /v1/contacts` |
| `contactIds` | array | IDs of all contacts of the quote. The set of bindings is replaced as a whole, so pass the full list |
| `companyId` | number | Company ID. List: `GET /v1/companies` |
| `mycompanyId` | number | Your company's details |
| `assignedById` | number | Assignee. List: `GET /v1/users` |
| `opened` | boolean | Available to everyone |
| `comments` | string | Comment |
| `content` | string | Content |
| `terms` | string | Terms |
| `beginDate` | datetime | Start date |
| `closeDate` | datetime | Close date |
| `actualDate` | datetime | Valid until |
| `locationId` | string | Location |
| `webformId` | number | CRM form that created the quote |
| `storageTypeId` | number | File storage type |
| `storageElementIds` | array | IDs of files in the storage |
| `lastActivityBy` | number | Author of the last activity. List: `GET /v1/users` |
| `utmSource` | string | UTM Source |
| `utmMedium` | string | UTM Medium |
| `utmCampaign` | string | UTM Campaign |
| `utmContent` | string | UTM Content |
| `utmTerm` | string | UTM Term |
| `ufCrm*` | per field schema | A user field of the Bitrix24 account. The name and type are in the schema [`GET /v1/quotes/fields`](/docs/entities/quotes/fields), and the value format for each type is in [User fields (UF)](/docs/entity-api#user-fields-uf) |

Fields marked RO on the [Quote fields](/docs/entities/quotes/fields) page cannot be changed — a request that includes them is rejected with `400 READONLY_FIELD`.

> **Field names.** In responses, fields are returned in camelCase: `amount`, `currency`, `beginDate`, `closeDate`. On write, both forms are accepted: these camelCase names and the original Bitrix24 names `opportunity`, `currencyId`, `begindate`, `closedate`. The API layer maps them to the names Bitrix24 expects.

## Examples

### curl — personal key

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/quotes/412" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stageId": "APPROVED",
    "isManualOpportunity": true,
    "opportunity": 1450
  }'
```

### curl — OAuth application

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/quotes/412" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "stageId": "APPROVED",
    "isManualOpportunity": true,
    "opportunity": 1450
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/quotes/412', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    stageId: 'APPROVED',
    isManualOpportunity: true,
    opportunity: 1450,
  }),
})

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

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/quotes/412', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    stageId: 'APPROVED',
    isManualOpportunity: true,
    opportunity: 1450,
  }),
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | object | The updated quote object with all fields — see [Quote fields](/docs/entities/quotes/fields) |
| `meta.warnings` | array | Present when the body carries fields that are neither in the quote schema nor in the field list of [`GET /v1/quotes/fields`](/docs/entities/quotes/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`. On a route that wraps the field map itself, an object under `fields` is rejected with `400 NESTED_FIELDS_ENVELOPE` when the schema does not declare `fields`; pass fields flat at the JSON root. |

## Response example

```json
{
  "success": true,
  "data": {
    "id": 412,
    "title": "Quote for server hardware",
    "amount": 1450,
    "currency": "USD",
    "stageId": "APPROVED",
    "dealId": 741,
    "assignedById": 1,
    "updatedTime": "2026-04-15T15:10:00.000Z"
  }
}
```

## Error response example

404 — quote not found:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | Quote not found |
| 403 | `ACCESS_DENIED` | No access to the quote |
| 400 | `INVALID_REQUEST` | Invalid fields |
| 400 | `READONLY_FIELD` | The request body contains a read-only field, such as `clientEmail`. Such fields are marked in the RO column of [Quote fields](/docs/entities/quotes/fields) |
| 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

- [Working with files in CRM fields](/docs/recipes/crm-files)
- [Get a quote](/docs/entities/quotes/get)
- [Quote fields](/docs/entities/quotes/fields)
- [Batch](/docs/batch)
- [Limits and optimization](/docs/optimization)
