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

# Quickstart

> Create an API key and send your first WhatsApp message in under 30 seconds.

This guide takes you from zero to a sent WhatsApp message. You can use `curl` or the [official Node.js SDK](https://docs.routa.chat/en/sdk/overview.md).

## Prerequisites

Before you start, you need:

* An account on the [Routa dashboard](https://app.routa.chat).
* A connected **channel**. A channel is a WhatsApp number linked to your project. Connect it in the dashboard; the connection uses the guided *Embedded Signup* flow.
* To use the SDK: Node.js 22 or later.

> [!NOTE]
>
> There is no endpoint to connect channels through the API yet. Connect the number in the dashboard and use the channel `id` (`chan_...`) in your calls.

## Send your first message

**1. Create an API key**

In the dashboard, open the **API keys** page, in the **Developer** group of the sidebar, and create a key for your project. The key starts with `rt_live_` or `rt_test_` and is **shown only once**. Copy it and store it somewhere safe.

```bash theme={null}
export ROUTA_API_KEY="rt_live_..."
```

Learn more in [Authentication](https://docs.routa.chat/en/authentication.md).

**2. Check that the key works**

`GET /v1/whoami` has no side effects and returns the organization, the project and the scopes of the key.

```bash cURL theme={null}
curl https://api.routa.chat/v1/whoami \
  -H "Authorization: Bearer $ROUTA_API_KEY"
```

```ts Node.js theme={null}
import { Routa } from '@routa-chat/sdk'

const routa = new Routa({ apiKey: process.env.ROUTA_API_KEY! })
console.log(await routa.whoami())
```

```json Response theme={null}
{
  "organization_id": "org_01J8...",
  "project_id": "proj_01J8...",
  "api_key_id": "key_01J8...",
  "scopes": ["messages:read", "messages:write"]
}
```

**3. Send a message**

Provide the channel, the recipient in E.164 format and the text. The `Idempotency-Key` header makes sure a retry does not create a second message.

```bash cURL theme={null}
curl https://api.routa.chat/v1/messages \
  -H "Authorization: Bearer $ROUTA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "channel": "chan_01J8...",
    "to": "+5581999999999",
    "text": "Hi! Your order is confirmed."
  }'
```

```ts Node.js theme={null}
const message = await routa.messages.send({
  channel: 'chan_01J8...',
  to: '+5581999999999',
  text: 'Hi! Your order is confirmed.',
})

console.log(message.id, message.status) // "msg_...", "accepted"
```

```json Response (202 Accepted) theme={null}
{
  "id": "msg_01J8...",
  "channel": "chan_01J8...",
  "direction": "outbound",
  "origin": "api",
  "from": "+5581988888888",
  "to": "+5581999999999",
  "content": { "type": "text", "body": "Hi! Your order is confirmed." },
  "content_redacted_at": null,
  "status": "accepted",
  "failure_code": null,
  "metadata": {},
  "accepted_at": "2026-09-04T13:22:40.812Z",
  "sent_at": null,
  "delivered_at": null,
  "read_at": null,
  "failed_at": null
}
```

**4. Track delivery**

`status: "accepted"` means Routa received the message, **not** that it reached the recipient. The message moves on to `sent`, `delivered` and `read` (or `failed`). Check the current state at any time:

```bash theme={null}
curl https://api.routa.chat/v1/messages/msg_01J8... \
  -H "Authorization: Bearer $ROUTA_API_KEY"
```

In production, receive each step through [webhooks](https://docs.routa.chat/en/webhooks/overview.md) instead of polling the API.

> [!WARNING]
>
> Accepting a message does not confirm delivery. Never treat `202 Accepted` as a delivered message. See the [message lifecycle](https://docs.routa.chat/en/concepts/messages.md).

## Next steps

> [card] [Receive events by webhook](https://docs.routa.chat/en/webhooks/overview.md)
>
> Register an HTTPS endpoint and receive `message.delivered`, `message.read` and `message.received`.

> [card] [Send templates](https://docs.routa.chat/en/guides/send-template-message.md)
>
> Send messages with templates approved by WhatsApp.

> [card] [Handle errors](https://docs.routa.chat/en/errors/overview.md)
>
> Understand the error format and which failures are worth a retry.

> [card] [API reference](https://docs.routa.chat/en/api-reference/introduction.md)
>
> Every endpoint, parameter and response.


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