
## Update contact

`PATCH /v1/contacts/:id`

Updates fields of an existing contact. Pass only the fields you want to change. See the full list in the [field reference](/docs/entities/contacts/fields).

> **Important note on `email` / `phone` (multifield):** On update, Bitrix24 **only adds** new multifield records. A PATCH with `{"email": "new@y.com"}` to a contact that already has an email **will not replace** the old one — the contact will end up with two emails. This is Bitrix24-specific behavior, not Vibecode's. To replace or remove an email/phone, edit the contact in the Bitrix24 UI. An object with an `id` field (an attempt to update or delete a single row) is not accepted by this PATCH: `400 MULTIFIELD_ID_NOT_SUPPORTED`, and nothing is written. An object keyed by row ids (`{"fm": {"11": {…}}}`, or the same shape in `phone`/`email`) is refused as well: `400 MULTIFIELD_ID_NOT_SUPPORTED`. The raw `fm` is accepted only as an array.

## Parameters

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

## Frequently updated fields

| Parameter | Type | Description |
|----------|-----|---------|
| `name` | string | First name, at most 50 Unicode code points. Longer values are rejected before writing; the name is not truncated. |
| `phone` | string \| string[] \| object[] | Phone. Accepts three forms: a string `"+1..."`, an array of strings `["+1...", "+1..."]`, or an array of objects `[{ "value": "+1...", "typeId": "WORK" }, …]`. `typeId`: `WORK \| HOME \| MOBILE \| OTHER` (default `WORK`). **Important:** the upper-case form `[{ "VALUE": "...", "VALUE_TYPE": "WORK" }]` is **not accepted** — it returns `400 INVALID_MULTIFIELD_SHAPE`. Use camelCase: `[{ "value": "...", "typeId": "WORK" }]` |
| `email` | string \| string[] \| object[] | Email. Accepts three forms: a string `"a@b.com"`, an array of strings `["a@b.com", "b@c.com"]`, or an array of objects `[{ "value": "a@b.com", "typeId": "WORK" }, …]`. `typeId`: `WORK \| HOME \| MAILING \| OTHER` (default `WORK`). **Important:** the upper-case form `[{ "VALUE": "...", "VALUE_TYPE": "WORK" }]` is **not accepted** — it returns `400 INVALID_MULTIFIELD_SHAPE`. Use camelCase: `[{ "value": "...", "typeId": "WORK" }]` |
| `companyId` | number | Company ID. Lookup: `GET /v1/companies` |
| `assignedById` | number | Assigned user. List: `GET /v1/users` |
| `post` | string | Position |
| `ufCrm*` | per field schema | A user field of the Bitrix24 account, for example `ufCrmProjectCode`. The actual name and type are in the schema [`GET /v1/contacts/fields`](/docs/entities/contacts/fields), and the value format for each type is in [User fields (UF)](/docs/entity-api#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 `ID`s. 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

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/contacts/71" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+12025550123",
    "post": "Director"
  }'
```

### curl — OAuth application

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/contacts/71" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+12025550124",
    "post": "Director"
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/contacts/71', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    phone: '+12025550125',
    post: 'Director',
  }),
})

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

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/contacts/71', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    phone: '+12025550126',
    post: 'Director',
  }),
})

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

### Alternative form — array of objects with explicit `typeId`

If you need to specify multiple values or an explicit type (`HOME`, `MOBILE`):

```json
{
  "phone": [
    { "value": "+12025550127", "typeId": "WORK" },
    { "value": "+12025550123", "typeId": "MOBILE" }
  ],
  "email": [
    { "value": "work@example.com", "typeId": "WORK" },
    { "value": "personal@example.com", "typeId": "HOME" }
  ]
}
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `data` | object | Updated contact object with all fields — see [Fields](/docs/entities/contacts/fields) |

The updated contact object — see [Contact fields](/docs/entities/contacts/fields).


## Response example

```json
{
  "success": true,
  "data": {
    "id": 71,
    "name": "John",
    "lastName": "Brown",
    "companyId": 15,
    "assignedById": 1,
    "createdTime": "2020-05-08T10:48:20+00:00",
    "updatedTime": "2026-04-15T12:00:00+00:00"
  }
}
```

## Error response example

404 — contact not found:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | Contact not found |
| 422 | `BITRIX_ERROR` | After the update, both `name` and `lastName` of the contact would be empty. The response has `error.b24Code` set to `CRM_FIELD_ERROR_REQUIRED`, and the contact is not changed |
| 403 | `ACCESS_DENIED` | No access |
| 400 | `INVALID_REQUEST` | Invalid fields |
| 400 | `READONLY_FIELD` | The request body contains a read-only field, such as `phoneMobile`. Such fields are marked in the RO column of [Contact fields](/docs/entities/contacts/fields) |
| 400 | `INVALID_MULTIFIELD_SHAPE` | Wrong shape for `phone` or `email`: the form with upper-case `VALUE` / `VALUE_TYPE` keys is not accepted; the API expects `[{ "value", "typeId" }]`. The same code is returned when `phone` or `email` holds an object without `value` — for example empty or with keys such as `n0`, `0` or `011` — or a number or `true`/`false`, on its own or as an array item, or when the raw `fm` is not an array, for example a string, a number, an empty object or an object keyed by type such as `PHONE`: `fm` is accepted only as an array `[{ "typeId", "valueType", "value" }]`. The request is refused and nothing is written |
| 400 | `MULTIFIELD_ID_NOT_SUPPORTED` | `phone`, `email` or the raw `fm[]` contains an object with an `id` field. Bitrix24 neither updates nor deletes a single multifield row through this call — it would append a duplicate — so the request is refused and nothing is written. The same refusal applies when `fm`, `phone` or `email` is sent as an object keyed by row ids (`{"fm": {"11": {…}}}`): updating or deleting a single multifield row by `id` through the API is not possible |
| 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).

## Known specifics

- **A contact without a first and last name is not updated.** If both `name` and `lastName` of an existing contact are empty, the update is refused even when the request changes other fields only, such as `post`. To update such a contact, send `name` or `lastName` in the same request. In a bulk update via `POST /v1/contacts/batch`, the item for such a contact gets `success: false` and `error` set to `CRM_FIELD_ERROR_REQUIRED`.

## See also

- [Working with files in CRM fields](/docs/recipes/crm-files)
- [Get contact](/docs/entities/contacts/get)
- [Contact fields](/docs/entities/contacts/fields)
- [Batch](/docs/batch)
- [Limits and optimization](/docs/optimization)
