{
"event": "chat_ended",
"chat": {
"chat_id": "3f9e2a64-8c1b-4d7e-9f20-5b6a7c8d9e01",
"loop_id": "ba99c99d-19b9-4a0d-8df6-3e213088989a",
"attempt": 2,
"channel": "sms",
"direction": "outbound",
"from_number": "+17755719467",
"to_number": "+14155552671",
"external_contact_id": "external-123",
"contact_id": "6bd1e7e0-6d00-4c0b-ad5b-daa72457a27d",
"contact_details": {
"company": "Art Studio Inc"
},
"contact_properties": [
{
"key": "industry",
"value": "retail",
"dataType": "string",
"label": "Industry"
}
],
"agent_id": "d8931604-92ad-45cf-9071-d9cd2afbad0c",
"triggered_at": 1731956924302,
"triggered_at_iso": "2024-11-18T15:08:44.302Z",
"started_at": 1731957645000,
"started_at_iso": "2024-11-18T15:20:45.000Z",
"ended_at": 1731959505000,
"ended_at_iso": "2024-11-18T15:51:45.000Z",
"status": "connected",
"transcript": "Agent: Hi Frida, are you still interested in an ice cream machine?\nUser: Yes, but it was too expensive.\nAgent: Thanks, I will pass that on.",
"transcriptObject": [
{
"role": "agent",
"content": "Hi Frida, are you still interested in an ice cream machine?"
},
{
"role": "user",
"content": "Yes, but it was too expensive."
},
{
"role": "agent",
"content": "Thanks, I will pass that on."
}
],
"outcomes": [
{
"key": "custom_lost_reason",
"dataType": "category",
"value": "PRODUCT_TOO_EXPENSIVE",
"reason": "The contact said the product was too expensive."
}
]
},
"contact": {
"contact_id": "6bd1e7e0-6d00-4c0b-ad5b-daa72457a27d",
"external_contact_id": "external-123",
"external_url": null,
"created_at": "2024-11-18T15:00:00.000Z",
"gender": null,
"first_name": "Frida",
"last_name": "Kahlo",
"phone_number": "+14155552671",
"in_call_since": null,
"reached_at": "2024-11-18T15:20:45.000Z",
"contact_details": {
"company": "Art Studio Inc"
},
"call_attempts": 1,
"next_call_at": null,
"email": "[email protected]",
"timezone": "America/Los_Angeles",
"salutation": "Ms.",
"status": "reached",
"properties": [
{
"key": "industry",
"value": "retail",
"dataType": "string",
"label": "Industry"
}
]
}
}Events
Chat ended
Payload telli sends when an SMS chat ends
WEBHOOK
chat_ended
{
"event": "chat_ended",
"chat": {
"chat_id": "3f9e2a64-8c1b-4d7e-9f20-5b6a7c8d9e01",
"loop_id": "ba99c99d-19b9-4a0d-8df6-3e213088989a",
"attempt": 2,
"channel": "sms",
"direction": "outbound",
"from_number": "+17755719467",
"to_number": "+14155552671",
"external_contact_id": "external-123",
"contact_id": "6bd1e7e0-6d00-4c0b-ad5b-daa72457a27d",
"contact_details": {
"company": "Art Studio Inc"
},
"contact_properties": [
{
"key": "industry",
"value": "retail",
"dataType": "string",
"label": "Industry"
}
],
"agent_id": "d8931604-92ad-45cf-9071-d9cd2afbad0c",
"triggered_at": 1731956924302,
"triggered_at_iso": "2024-11-18T15:08:44.302Z",
"started_at": 1731957645000,
"started_at_iso": "2024-11-18T15:20:45.000Z",
"ended_at": 1731959505000,
"ended_at_iso": "2024-11-18T15:51:45.000Z",
"status": "connected",
"transcript": "Agent: Hi Frida, are you still interested in an ice cream machine?\nUser: Yes, but it was too expensive.\nAgent: Thanks, I will pass that on.",
"transcriptObject": [
{
"role": "agent",
"content": "Hi Frida, are you still interested in an ice cream machine?"
},
{
"role": "user",
"content": "Yes, but it was too expensive."
},
{
"role": "agent",
"content": "Thanks, I will pass that on."
}
],
"outcomes": [
{
"key": "custom_lost_reason",
"dataType": "category",
"value": "PRODUCT_TOO_EXPENSIVE",
"reason": "The contact said the product was too expensive."
}
]
},
"contact": {
"contact_id": "6bd1e7e0-6d00-4c0b-ad5b-daa72457a27d",
"external_contact_id": "external-123",
"external_url": null,
"created_at": "2024-11-18T15:00:00.000Z",
"gender": null,
"first_name": "Frida",
"last_name": "Kahlo",
"phone_number": "+14155552671",
"in_call_since": null,
"reached_at": "2024-11-18T15:20:45.000Z",
"contact_details": {
"company": "Art Studio Inc"
},
"call_attempts": 1,
"next_call_at": null,
"email": "[email protected]",
"timezone": "America/Los_Angeles",
"salutation": "Ms.",
"status": "reached",
"properties": [
{
"key": "industry",
"value": "retail",
"dataType": "string",
"label": "Industry"
}
]
}
}The
chat_ended event is sent once for each SMS chat between an agent and a contact, after the chat has ended and its outcomes are stored. A chat ends after a period without new messages, when its call loop ends it, or when telli could not send its first message.
The payload mirrors call_ended for SMS chats. Fields that only apply to phone calls, such as call_status, recording_url, or collected_data, are left out.
Chat status
chat.status describes what happened in the chat:
connected— the contact wrote at least one messagenot_connected— the contact never wrotefailed— telli could not send the first message
chat.direction is outbound when telli started the chat and inbound when the contact started it. started_at is the time of the contact’s first message in the chat, or null when the contact never wrote.
Outcomes
chat.outcomes has the same shape as outcomes in call_ended. chat.chat_id is the identifier the chat’s outcome values are stored under. Chats of one call loop share its loop_id with the loop’s calls, and attempt counts both calls and chats.Body
application/json
Response
2XX
Acknowledged. Return any 2xx within 15 seconds or the message is retried.
Was this page helpful?