Skip to navigation

Get pre-call context

Returns the contact, the latest conversation, the recent messages, and a text summary of a customer as 1 flat map of strings. An external voice agent can use each key as a template variable. Give 1 of conversation_id, contact_id, or phone_number. If the request has more than 1, the API reads them in that order. The endpoint only reads data.

Authentication

api_access_tokenstring

An API key that an administrator creates in Settings > Developer. The personal access token of a user does not work. A key reaches every inbox, conversation, and contact in the account that created it, and nothing in other accounts.

Path parameters

account_idintegerRequired

The id of your account. It is the number after /accounts/ in the dashboard URL.

Query parameters

conversation_idintegerOptional

The conversation number in the dashboard URL (display_id).

contact_idintegerOptional
The id of the contact. The API uses the conversation of the contact with the most recent activity, in any inbox.
phone_numberstringOptional

The phone number of the contact in E.164 format. The API adds the + if it is not there. The API uses the conversation of the contact with the most recent activity.

Response

The context of the customer.
contact_idstringOptional
contact_namestringOptional
contact_emailstringOptional
contact_phone_numberstringOptional
contact_identifierstringOptional
contact_contact_typestringOptional

visitor, lead, or customer.

conversation_idstringOptional

The internal id of the conversation. It is not the number in the dashboard URL. The other developer endpoints take conversation_display_id.

conversation_display_idstringOptional
The conversation number in the dashboard URL.
conversation_inbox_idstringOptional
conversation_contact_idstringOptional
conversation_statusstringOptional
conversation_prioritystringOptional
conversation_label_liststringOptional
The labels, with a comma and a space between them.
messagesstringOptional

1 line for each public message, oldest first, with the prefix user: or assistant:. The last 100 messages, up to 40,000 characters. Empty when there is no conversation.

summarystringOptional
The same context as a Markdown text, for the prompt of a voice agent.

Errors

401
Unauthorized Error
404
Not Found Error
422
Unprocessable Entity Error