Sync a contact by integration and external ID

Upserts (creates or updates) a Talkdesk contact by matching on the combination of integration_id and external_id. If a contact with the given integration mapping already exists, it is updated; otherwise a new contact is created.

Brand Sentinel Mechanism

The custom_fields array is the mechanism for identifying which store/brand a contact belongs to. The brand sentinel is a custom field entry with key = external_id and value = the brand/store identifier. When the brand sentinel is present in the request body:

  1. When multiple contacts match the same integration_id + external_id, the brand
    sentinel is used to disambiguate — the service selects the contact whose
    custom_fields contain the matching brand sentinel for update.

  2. If a single match exists but its brand sentinel differs from the one in the
    request body, the contact is treated as a non-match and the system falls through
    to the no-match logic (see existing_contact_id below).

  3. An empty brand sentinel value is treated as "no brand" (same as omitting it).

Contact Resolution Logic

The service resolves which contact to create or update based on the following decision tree:

  • Multiple matches (matched > 1):

    • If brand sentinel present in request body → select the contact matching the brand; update it.
    • If no brand match found → fall through to no-match logic.
    • If brand sentinel not present → return matches as-is (no update performed).
  • Single match (matched == 1):

    • If brand sentinel not present → update the matched contact.
    • If brand sentinel present and contact has no brand sentinel → adopt the brand and update.
    • If brand sentinel present and sentinel matches → update.
    • If brand sentinel present and sentinel differs → treat as no-match (fall through).
  • No match (matched == 0, or delegated from above):

    • If existing_contact_id provided → attempt to reuse that contact (merge), unless
      it already has a conflicting integration for the same integration_id (in which
      case a new contact is created instead).
    • If existing_contact_id not provided → create a new contact.

Merge Strategy (when updating)

  • custom_fields: key-based merge — matching keys are overwritten, new keys are appended,
    absent keys are preserved.

  • integrations: matched by integration_id + external_id pair; existing entries are
    updated, new entries are appended.

  • Scalar fields (name, address): overwritten if provided, preserved if omitted (null).

  • Array fields (tags, emails, phones): replaced entirely if provided.

Request Body Validation

  • contact.id must be empty (omit it or set to null).
  • contact.integrations must contain at least one entry with integration_id and
    external_id matching the path parameters — otherwise 400 is returned.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Scope

entitymapper-contacts:write

Path Params
string
required
length ≥ 1

The integration platform identifier. Determines which external system the contact originates from (e.g., "shopify", "bigcommerce", "salesforce").

string
required
length ≥ 1

The unique identifier of the contact in the external system. Used together with integration_id to locate or create the Talkdesk contact mapping.

Query Params
string
length between 24 and 24

(optional) when no contact matches the integration_id + external_id lookup (or when a brand mismatch causes delegation to no-match logic).

When this parameter is provided and the no-match path is triggered, the service will attempt to reuse (merge into) this existing contact rather than creating a new one. However, if the existing contact already has an integration entry for the same integration_id, it cannot be reused and a new contact is created instead.

Typical use case: the caller already knows the Talkdesk contact from a prior interaction (e.g., the contact was identified during a phone call) and wants to link the external entity to that same contact.

Body Params
tags
array of strings

The tags associated with the contact

tags
string | null

Full name of the contact.

string | null

Mailing or physical address of the contact.

emails
array of objects

Email addresses associated with the contact.

emails
phones
array of objects

Phone numbers associated with the contact.

phones
custom_fields
array of objects

Custom fields associated with the contact. The brand sentinel custom field (key = external_id, value = brand) is the primary mechanism for associating a contact with a specific store/brand. Callers must include the brand sentinel explicitly in this array for multi-brand disambiguation to work. Merge strategy is key-based: matching keys are overwritten, new keys appended, absent keys preserved.

custom_fields
integrations
array of objects
required

Integration mappings for this contact. Each entry links the contact to a record in an external system. At least one integration entry matching the path parameters (integration_id + external_id) is required.

integrations*
Responses

Language
Credentials
OAuth2
Missing 1 required scope
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json