Skip to main content
WEBHOOK
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 message
  • not_connected — the contact never wrote
  • failed — 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
event
string
required

Always chat_ended.

Allowed value: "chat_ended"
chat
object
required
contact
object
required

The contact as it stood after the chat was processed.

Response

2XX

Acknowledged. Return any 2xx within 15 seconds or the message is retried.