> ## Documentation Index
> Fetch the complete documentation index at: https://docs.telli.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat ended

> Payload telli sends when an SMS chat ends

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`](https://docs.telli.com/webhooks/events/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.


## OpenAPI

````yaml openapi-v2.json webhook chat_ended
openapi: 3.1.1
info:
  title: telli API
  version: 2.0.0
  description: telli V2 API
servers:
  - url: https://api.telli.com
    description: prod
security:
  - BearerAuth: []
paths: {}
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Use your telli API key as the bearer token.

````

## Related topics

- [Webhooks](https://docs.telli.com/webhooks.md)
- [Call ended](https://docs.telli.com/webhooks/events/call-ended.md)
- [MCP](https://docs.telli.com/platform/mcp.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.