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

# Introduction

> Build agents that users message as Contacts in Relay Messenger.

Relay Messenger connects users and agents in direct and group conversations.

> **New to Relay?** Follow the [Quickstart](/getting-started/quickstart) to connect an agent, or open the [API Reference](/api-reference/overview) for every endpoint and schema.

Use the official [TypeScript SDK](/getting-started/sdks) for a Node agent
backend, or call the same `/v1` operations over HTTPS.

## Prerequisites

To build an agent, you need:

* An agent and Agent Token from [Relay Console](https://console.relayapp.im)
* A durable database or queue for incoming events
* A public HTTPS endpoint for a saved webhook subscription, or an always-on
  process that connects when no subscription is saved

## What you can build

* **Personal agents** that live beside a user's other conversations
* **Support agents** that reply with text, media, audio, and files
* **Group agents** that respond when mentioned in a shared Chat
* **Webhook backends** that receive signed HTTPS requests
* **Always-on backends** that receive events over a WebSocket

## Key capabilities

| Capability            | Description                                                                                      |
| --------------------- | ------------------------------------------------------------------------------------------------ |
| Multipart Messages    | Send ordered text, media, and link parts                                                         |
| Attachments           | Upload images, video, audio, and files up to 100 MB                                              |
| Group Chats           | Add and remove Contacts, rename groups, and set group photos                                     |
| Replies and reactions | Target an exact Message part                                                                     |
| Contact Cards         | Configure an agent's name and photo, then share it into an existing Chat                         |
| Delivery state        | Track Sent, Delivered, and Read per recipient                                                    |
| Agent events          | Save a webhook subscription for signed HTTP delivery, or connect by WebSocket when none is saved |

## Authentication

Every request uses a bearer credential:

```http theme={null}
Authorization: Bearer $RELAY_AGENT_TOKEN
```

Users and agents call the same `/v1` API. The credential determines the Contact and permissions.

## Quick example

Send a Message to an existing Chat:

<CodeGroup>
  ```typescript TypeScript SDK theme={null}
  await relay.chats.messages.send(chatId, {
    message: {
      parts: [{ type: "text", value: "I can help with that." }],
      idempotency_key: `reply-${eventId}`,
    },
  });
  ```

  ```bash cURL theme={null}
  curl -sS -X POST https://api.relayapp.im/v1/chats/$CHAT_ID/messages \
    -H "Authorization: Bearer $RELAY_AGENT_TOKEN" \
    -H "Content-Type: application/json" \
    -H "Idempotency-Key: reply-$EVENT_ID" \
    -d '{
      "message": {
        "parts": [{"type":"text","value":"I can help with that."}]
      }
    }'
  ```
</CodeGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" href="/getting-started/quickstart">
    Receive one Message and send one reply.
  </Card>

  <Card title="Client SDKs" href="/getting-started/sdks">
    Use the official TypeScript client.
  </Card>

  <Card title="Messaging" href="/guides/messaging">
    Send text, media, voice memos, replies, mentions, and reactions.
  </Card>

  <Card title="Webhooks" href="/guides/webhooks">
    Receive signed events at an HTTPS endpoint.
  </Card>

  <Card title="WebSocket" href="/guides/websocket">
    Receive events through an always-on connection.
  </Card>
</CardGroup>
