Skip to main content

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

ParameterTypeRequiredDescription
idstringrequiredThe contact ID.

Request Body

FieldTypeRequiredDescription
fieldsobjectrequiredKey-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.
tagsarray of integersoptionalReplaces the contact's current tags with the provided tag IDs.
statusstringrequiredContact 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_REMOVED automations if tags change.
  • Fires FIELD_UPDATED automations if tracked field values change.
  • No status-change automations fire.

Errors

StatusMessageCause
400The contact ID you provided is not valid.id path param is missing.
400Please provide at least one field to update.fields is empty or missing.
400Please provide a status.status is missing.
400The status you provided is not valid.Invalid status value.
400We were unable to find a field with the merge_tag <tag>A key in fields doesn't match any workspace merge tag.
400We couldn't find a contact with that ID.Contact does not exist in this workspace.