Update Contact

Objective: To modify specific fields of an existing contact record without creating a duplicate. This is used when a lead updates their information or when a workflow requires a status change (e.g., adding a tag).


1. Endpoint Configuration

  • HTTP Method: PATCH

  • Base URL: https://api.assistable.ai/v2/contacts/

  • Path Parameter: :id (This corresponds to the specific contact_id generated upon creation)

  • Full Request URL:

    https://api.assistable.ai/v2/contacts/{contact_id}

Crucial Difference: Unlike the Create Contact endpoint which uses the location_id in the URL, this endpoint requires the specific contact_id.


2. Payload Preparation (Request Body)

The request body uses JSON. Since this is a PATCH request, you typically only need to include the fields you wish to update. However, the full schema is available if a complete overwrite is necessary.

Field

Type

Description

first_name

String

Updates the first name.

last_name

String

Updates the last name.

phone_number

String

Updates the phone number. Must follow E.164 format.

email

String

Updates the email address.

tags

Array

Overwrites the current tag list. Ensure you include existing tags if you want to keep them.

custom_fields

Object

Updates specific custom data points.

Example JSON Payload

Scenario: Fixing a typo in the name and adding a new tag.

JSON

{
"first_name": "Jorden",
"last_name": "Williams",
"tags": [
"lead-form-submitted",
"contacted-via-phone"
]
}

3. Execution Steps

  1. Retrieve Contact ID: Ensure you have the UUID (id) of the contact you wish to update. This is usually stored from the initial Create Contact response or retrieved via a Get Contact query.

  2. Construct Payload: Create a JSON object containing only the fields that need changing (unless a full replace is intended).

  3. Send Request: Execute the PATCH request to the specific contact URL.

  4. Validate Response: Confirm the response returns the updated contact object with the updated_at timestamp refreshed.


4. Response Verification

A successful request returns the fully updated contact object. Verify that the fields you intended to change are reflected in the response.

Success Response Example:

JSON

{
"id": "3a0b342a-46eb-430a-8ea3-dba2a4d450f7",
"workspace_id": "test-workspace",
"location_id": "test-location",
"first_name": "Jorden",
"last_name": "Williams",
"phone_number": "+17702967271",
"email": "jorden@assistable.ai",
"tags": [],
"meta": {},
"custom_fields": {},
"attribution": {},
"integration": {},
"dnd": {},
"created_at": "2025-12-03T18:50:51.906176+00:00",
"updated_at": "2025-12-03T19:07:55.343337+00:00"
}

5. Troubleshooting

  • 404 Not Found: The contact_id in the URL does not exist. Double-check that you are using the Contact ID and not the Location ID.

  • Tags Disappeared: If you send a tags array, it often replaces the existing array rather than appending. Ensure you fetch existing tags and merge them with new ones before sending the request if your goal is to append.


Was this article helpful?