Update a contact

Partially update a contact's name, tags, custom fields or assigned user.

PATCH/contacts/:uuid

Authentication

This endpoint authenticates with your API key sent in the X-API-Key header (ek_live_... format). You can manage your API keys from the Dev Tools section of the dashboard.

Path parameters

ParameterTypeRequiredDescription
uuidStringRequiredUUID of the contact to update.

Request body

ParameterTypeRequiredDescription
nameStringOptionalFull name; it is split into first and last name.
tagsArrayOptionalFull list of tags for the contact; replaces the existing tags and is synced to the contact's conversations.
custom_fieldsObjectOptionalKey-value pairs merged into the contact's existing custom fields.
assigned_userStringOptionalEmail of the business user to assign the contact to.
unassign_userBooleanOptionalWhen true, removes the currently assigned user.

Example request

bash
curl -X PATCH "https://eclectic-api-537143970188.us-central1.run.app/api/external/v2/contacts/eb2b914a-977e-4ab8-96e7-b886698b3eac" \
  -H "X-API-Key: ek_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "tags": ["vip"],
    "custom_fields": {
      "rut": "12345678-9"
    },
    "assigned_user": "agent@example.com"
  }'

Example response

json
{
  "contact": [
    {
      "uuid": "eb2b914a-977e-4ab8-96e7-b886698b3eac",
      "name": "John Doe",
      "phoneNumber": "+56912345678",
      "avatarUrl": null,
      "createdAt": "2024-09-23T20:09:10Z",
      "source": "whatsapp",
      "closedAt": null,
      "href": "https://dash.try-eclectic.com/contacts/eb2b914a977e4ab896e7b886698b3eac",
      "conversationHref": "https://dash.try-eclectic.com/chat/f3670b13446b412796238b1cd78899f9",
      "tags": ["vip"],
      "assignedUser": "agent@example.com",
      "customFields": {
        "rut": "12345678-9"
      }
    }
  ]
}

Notes

  • custom_fields are merged with the existing values; only the keys you send are updated.
  • tags is a full replacement, not a merge — send the complete list.
  • Possible errors: 400 (validation), 401 (invalid or missing API key), 404 (contact not found).