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

# Messaging

> APIs for the two sides of a Text conversation — agent and customer.

Everything that happens in a Text conversation — a customer starting a chat, an agent replying, a bot taking over — runs through one of these APIs.

The Web API is request-response: your system calls Text, Text responds — works for bots, automations, and backend scripts. RTM is push-based: Text streams events to your open WebSocket in real time, no polling needed. Choose RTM when you're building a live agent interface where messages need to appear instantly. Bots can only use the Web API.

## Agent Chat API

**What it does:** Exposes the agent side of Text: sending and receiving messages, managing chats and routing, and accessing conversation history. Bots use this API too — at the protocol level they're treated the same as human agents.

**When you'd use it:**

* Building a bot that handles customer questions
* Pulling chat transcripts into your CRM when a conversation ends
* Sending automated messages triggered by events in another system
* Creating a custom agent interface

<CardGroup cols={2}>
  <Card title="Agent Chat API (Web)" icon="globe" href="/api/agent-chat/">
    Request-response model for bots, automations, and server-side integrations.
  </Card>

  <Card title="Agent Chat API (RTM)" icon="tower-broadcast" href="/api/agent-chat/rtm">
    WebSocket connection for live agent interfaces. Bots use the Web API
    instead.
  </Card>
</CardGroup>

## Customer Chat API

**What it does:** Exposes the customer side of Text — starting chats, sending messages, and attaching data. Use it to connect Text to channels beyond the standard widget: mobile apps, custom interfaces, or external messaging platforms. Always paired with the Customer Accounts API, which handles customer authentication.

**When you'd use it:**

* Building a custom chat interface for your mobile app
* Routing messages from external channels (SMS, social media) into Text
* Attaching customer data to a chat before it reaches an agent

<CardGroup cols={2}>
  <Card title="Customer Chat API (Web)" icon="message" href="/api/customer-chat/">
    Request-response model for custom customer-side integrations.
  </Card>

  <Card title="Customer Chat API (RTM)" icon="comment" href="/api/customer-chat/rtm">
    WebSocket connection for live chat experiences where messages arrive
    instantly.
  </Card>
</CardGroup>

## Ticketing API

**What it does:** Programmatic access to the ticketing layer — tickets, agents, teams, tags, automations, and reporting. For teams that handle support through email and tickets rather than live chat.

**When you'd use it:**

* Creating tickets automatically from external events (a failed order, a form submission)
* Syncing ticket data into your CRM or BI tools
* Automating ticket routing, tagging, or status changes

<Card title="Ticketing API" icon="ticket" href="/api/ticketing" horizontal>
  Full reference for the ticketing API — tickets, agents, teams, automations,
  and reporting.
</Card>
