Skip to main content
POST
Links a session_id to a contact. The events that were waiting for that session (sent with the session_id and no contact data, answered as pending by Send events) move to the contact within a minute, with their original date, and show up in the contact’s activity marked Before identifying. Events sent afterwards with only that session_id go straight to the contact. Call it when your site learns who the visitor is and has no event to send at that moment: a login, a sign-up, the end of a checkout. It does not take group: to link the contact to a company, send an event with it. If you do have an event with contact data, such as the purchase, sending it with the same session_id identifies the session too, and this call is not needed.
Part of the events add-on. Without it, this endpoint answers 403. See the events guide.

Headers

string
requerido
Your organization API key. See API keys.

Body Parameters

string
requerido
The same session_id sent with the anonymous events: a UUID your site keeps in the browser, or the Google Analytics client id. Up to 200 characters, no spaces.
object
requerido
Who the visitor turned out to be, with at least one of contact_id, external_id, phone (7 or more digits) or email. The contact is found the same way as in Send events.
boolean
predeterminado:"true"
Create the contact when none matches. With false, the session is only linked to a contact that already exists.

Response

The response is { "statusCode": 200, "data": object }. The fields below describe data.
string
  • linked: the session now belongs to contact.id; its pending events move to the contact within a minute.
  • already_linked: the session already belonged to another contact, which keeps it. conflict says which.
  • not_found: no contact matched and none was created; see reason.
string
The session, as it was linked.
object
The contact the session belongs to: id, matched_by (contact_id, external_id, phone, email, or null when it was just created) and created. null when the status is not_found.
number
How many events were waiting for the session and are now moving to the contact.
string
For not_found: not_found (no contact matched and create_contact was false), contact_limit_reached (your plan allows no more contacts) or ambiguous_email (the only data was an email shared by several contacts).
object
Present when something was ambiguous, as in Send events.

Errors