Skip to main content
POST
Authenticate a widget user by your own user id
Call this endpoint from your backend with an API key that has the widget:write scope. It returns the same verified token as Authenticate contact. Pass that token to the widget through user.token.
  • Matching: the contact is found by external_id alone. Email and phone are optional details on the contact: they can change, and several contacts can share them.
  • First call: a new contact is created with the external_id and the details you send, even when another contact already has the same email or phone.
  • Later calls: the contact with that external_id is updated with the details you send, such as a new email or phone.
  • Other ways in: email, phone, and messaging channels, and Authenticate contact, keep identifying people by email or phone. They never match a contact that has an external_id, so a message from the same address belongs to a separate contact.
  • Validation: external_id is required, can’t be blank, and is at most 255 characters.
The other fields match Authenticate contact, including http_action_overrides for your AI actions and mcp_access for personal connections. external_id identifies the contact. It is different from the widget’s user.externalId option, which only scopes session history in the browser. Send optional primary_external_id to record the main account’s external_id within your organization. Each contact keeps its own external_id and session history. The main contact does not need to exist yet, and several contacts can point to the same main account. You can create B and C before the main account:
  • Omit the field to preserve the current relationship. A new contact starts with null.
  • Send null to remove the relationship.
  • Send a string to set or replace the relationship, including with an ID that does not exist yet. Leading and trailing whitespace is removed; the remaining value must contain 1–255 characters.
  • Direct references: a primary contact can have its own primary account. If B points to A and A points to C, both references are stored as supplied; B continues to point to A. This also works when A is created after B.
  • Indirect cycles are allowed: A can point to B while B points to A. These references are stored without following the chain. If your integration follows these references, track visited contacts and stop when a contact repeats.
  • No self-links: a contact cannot use its own external_id as its primary_external_id. This returns 400 without saving the contact changes.
The authentication response includes the saved value in contact.primary_external_id. Contact detail, list, and search responses also expose it, as do contact objects in session, investigation, and CSAT responses. Set it through this authentication endpoint; contact create/update endpoints and email/phone authentication do not set it. In the dashboard, the contact page, contact preview, and inbox sidebar can show sessions from the entire connected group within your organization. Links are followed in both directions, including chains, cycles, and shared references to a main account that has not been created yet. Each session appears once and remains owned by its original contact. Agents can switch between All connected contacts and This contact; their session permissions still apply. See Connected contact history. Changing or clearing a reference updates the combined history on its next refresh, including past sessions. Another path between the contacts can keep them connected. This does not merge contacts, change authentication, expand customer widget history, or change general inbox contact filters or public session searches.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
external_id
string
required

The user's stable id in your system. The contact is matched by this id alone, so email and phone can change or be shared with other contacts.

Required string length: 1 - 255
email
string<email>
Pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
mcp_access
object
name
string
avatar_url
string | null
phone
string
language
enum<string>
Available options:
en,
fr,
de,
nl,
pl,
pt,
es,
it,
ru,
ja,
ko,
zh,
ar,
tr,
sv,
da,
no,
fi,
el,
cs,
hu,
th,
vi,
id,
he,
hi,
uk,
ro,
bg,
hr,
sk,
sl,
sr,
et,
lv,
lt,
is,
ga,
ms,
tl,
fa,
bn,
ta,
te,
ur,
sw,
zu,
af,
sq,
hy,
az,
eu,
be,
bs,
ca,
cy,
ku,
ckb,
kmr
customData
object
chat_context
string
http_action_overrides
object
primary_external_id
string | null

The primary account's external_id within your organization. The primary contact does not need to exist yet. Chains and indirect cycles are allowed; direct self-links are rejected. Omit to preserve the current value, send null to unlink, or send a string to set or replace it. The reference does not merge contacts or change customer access. Dashboard contact history can include all connected contacts, subject to the viewer’s session permissions.

Required string length: 1 - 255

Response

Default Response

token
string
required

The JWT token to use for further requests

contact
object
required