Update Contact
Update an existing contact's fields, tags, and status by their contact ID.
Endpoint
PUT https://api.campaignlark.com/v1/contacts/:id
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | required | The contact ID. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
fields | object | required | Key-value map of field values keyed by merge_tag. At least one field must be provided. All workspace-required fields must have a non-empty value. |
tags | array of integers | optional | Replaces the contact's current tags with the provided tag IDs. |
status | string | required | Contact status. One of SUBSCRIBED, UNSUBSCRIBED, UNCONFIRMED, CLEANED, COMPLAINED. |
Sample Request
PUT https://api.campaignlark.com/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1
Content-Type: application/json
{
"fields": {
"email_address": "Tyrion@example.com",
"first_name": "Tyrion"
},
"tags": [1, 3],
"status": "SUBSCRIBED"
}
Response
Success — 200 OK
{
"data": {
"id": "64f1a2b3c4d5e6f7a8b9c0d1",
"status": "SUBSCRIBED",
"tags": [
{ "id": 1, "name": "newsletter" },
{ "id": 3, "name": "vip" }
],
"data": {
"email_address": "tywin@example.com",
"first_name": "Tywin"
},
"statistics": {
"total_opens": 5,
"total_clicks": 2,
"total_bounces": 0,
"total_delivered": 5
},
"last_opened_at": "2024-02-14T09:00:00Z",
"last_clicked_at": null,
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-02-15T10:30:00Z"
}
}
Automation Behaviour
- Fires
TAG_ADDED/TAG_REMOVEDautomations if tags change. - Fires
FIELD_UPDATEDautomations if tracked field values change. - No status-change automations fire.
Errors
| Status | Message | Cause |
|---|---|---|
400 | The contact ID you provided is not valid. | id path param is missing. |
400 | Please provide at least one field to update. | fields is empty or missing. |
400 | Please provide a status. | status is missing. |
400 | The status you provided is not valid. | Invalid status value. |
400 | We were unable to find a field with the merge_tag <tag> | A key in fields doesn't match any workspace merge tag. |
400 | We couldn't find a contact with that ID. | Contact does not exist in this workspace. |