Source: https://www.brixit.io/docs/api-contacts-update

# Update contact

To update contact in Brixit, send a POST request to /api/automation/v1/execute with operation set to contacts.update. Include parameters.id to identify the record.

[Contacts API](https://www.brixit.io/docs/api-contacts) · `contacts.update`

[URL](https://www.brixit.io/docs/api-contacts-update#url-and-authentication) · [Fields](https://www.brixit.io/docs/api-contacts-update#fields) · [Example](https://www.brixit.io/docs/api-contacts-update#example-request) · [Response](https://www.brixit.io/docs/api-contacts-update#response) · [Try it](https://www.brixit.io/docs/api-contacts-update#try-it)

## URL and authentication

`POST https://YOUR-BACKEND/api/automation/v1/execute`

Send `Authorization: Bearer <connection key>`, `Accept: application/json` and
`Content-Type: application/json`. [Create a connection](https://www.brixit.io/docs/api#get-connected).

This operation requires **write access** and CRM permission `edit_contacts`.
The gateway invokes `PUT /api/v1/app/lead-contacts/{id}` internally.
Use the POST URL above with your automation key, including for read and delete operations.

## Request parameters

| Key | Type | Requirement |
| --- | --- | --- |
| `operation` | string | Required; exactly `contacts.update` |
| `parameters.id` | integer | Required; positive record ID from your CRM |
| `data` | object | Optional; see fields below |
| `idempotency_key` | string | Required; 8–100 characters. Unique per action; keep unchanged for identical retries. |

## Fields

Supply only the fields to change. The resulting contact must still have non-empty first and last names. Email uniqueness is checked if the email changes.

Fields below belong inside `data`. Dot paths describe nested objects; `*` means each
array item. `nullable` permits null and `sometimes` validates a supplied field.
`in:` lists allowed values; `min:` and `max:` limit the value, length or item count.
`exists:` and `exists_in_company:` require a valid record ID. Conditional rules
such as `required_if` and `required_with` refer to other fields in the same payload.
Use YYYY-MM-DD for date-only values and timestamps with timezone offsets for follow-ups.

| Field | Type | Requirement | Format / validation |
| --- | --- | --- | --- |
| `first_name` | string | Optional | sometimes; string; min:1; max:255 |
| `last_name` | string | Optional | sometimes; string; min:1; max:255 |
| `email` | string | Optional | sometimes; email — Must be available and unique within your company if changed. |
| `primary_phone` | string | Optional | sometimes; string; max:255 |
| `secondary_phone` | string | Optional | nullable; string; max:255 |
| `country_id` | integer | Optional | nullable; integer; exists:countries,id |
| `preferred_languages` | array | Optional | nullable; array |
| `preferred_languages.*` | integer | Optional | nullable; integer; exists:language_settings,id |
| `communication_preferences` | array | Optional | nullable; array |
| `communication_preferences.*` | string | Optional | nullable; in:email,whatsapp,phone,text,sms |
| `date_of_birth` | string | Optional | nullable; date |
| `gender` | string | Optional | nullable; in:male,female |
| `marital_status` | string | Optional | nullable; in:single,married,engaged,divorced,widowed,separated,other |
| `occupation` | string | Optional | nullable; string; max:255 |
| `company_name` | string | Optional | nullable; string; max:255 |
| `address` | string | Optional | nullable; string |
| `internal_notes` | string | Optional | nullable; string |
| `assigned_to` | integer | Optional | sometimes; integer; integer; exists_in_company:users |
| `source_id` | integer | Optional | nullable; integer; exists_in_company:lead_sources |
| `contact_stage_id` | integer | Optional | nullable; integer; exists_in_company:contact_stages |
| `priority` | string | Optional | nullable; in:high,medium,low |
| `custom_fields_data` | object | Optional | array — Object keyed by field_&lt;id&gt;. Required fields depend on your installation. URL fields require a URL; percentages are 0–100. File custom fields cannot be uploaded through this JSON API. |

## Example request

Replace the example IDs and values with records in your installation. Supply any
additional custom fields required by your company.

```json
{
  "operation": "contacts.update",
  "parameters": {
    "id": 1
  },
  "data": {
    "first_name": "Example",
    "last_name": "Contact"
  },
  "idempotency_key": "example-event-12345"
}
```

## Response

Returns the updated contact in `data`. Use `data.id` for subsequent requests. Related fields depend on the resource and your permissions.

The gateway preserves the underlying HTTP status and JSON body. Successful requests return **HTTP 200**. A response may also include localized message fields.

Illustrative response excerpt (additional fields may be returned):

```json
{
  "status": "success",
  "data": {
    "id": 456,
    "first_name": "Example",
    "last_name": "Contact",
    "email": "contact@example.com"
  }
}
```

## Errors

| HTTP status | Meaning |
| --- | --- |
| 400 | A CRM business rule rejected the action. |
| 401 | Missing, invalid, expired or revoked connection key. |
| 403 | Connection access or CRM permissions do not allow this action. |
| 404 | Operation or record unavailable. |
| 409 | This idempotency key was already used with a different request. |
| 413 | Request or result exceeds its size limit; reduce payload or page size. |
| 422 | Missing or invalid fields, or a CRM business rule rejected the operation. |
| 429 | Rate limit exceeded; wait before retrying. |
| 500 | The server could not complete the operation. |

Validation failures may return `message` / `errors`, or an `error` string with
an optional `fields` array. The tester shows the actual HTTP status and full body.
[Read about limits and retries](https://www.brixit.io/docs/api#errors-and-limits).

## Try it

[Open the interactive API tester](https://www.brixit.io/docs/api-contacts-update#try-it)
