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

# Conversation API

> Send free-form messages within an active 24-hour session

Once a customer has messaged you, you have a 24-hour window to reply with free-form text, media, or a quick-reply button message — no template required. This is the API your inbox and bots use to actually converse.

## Endpoint

```text theme={null}
POST https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/messages
```

### Request body

<ParamField body="to" type="string" required>
  Recipient's phone number in E.164 format.
</ParamField>

<ParamField body="type" type="string" required>
  One of `text`, `image`, `document`, `interactive`.
</ParamField>

<ParamField body="text" type="string">
  Message body, required when `type` is `text`.
</ParamField>

<ParamField body="media_url" type="string">
  Publicly reachable URL, required when `type` is `image` or `document`.
</ParamField>

<ParamField body="interactive" type="object">
  Required when `type` is `interactive`. Currently supports quick-reply buttons only: `{ "body": "...", "buttons": [{ "id": "yes", "title": "Yes" }] }`. List-style interactive messages aren't supported through this endpoint yet.
</ParamField>

```bash cURL theme={null}
curl https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/messages \
  -H "Authorization: Bearer tvk_live_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "to": "+919876543210", "type": "text", "text": "Thanks for reaching out! How can I help?" }'
```

```json Response theme={null}
{
  "message_id": "5a9e6f1c-9e2f-4b1c-8a5c-7e8f9a0b1c2d",
  "status": "accepted"
}
```

### Checking message status

```text theme={null}
GET https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/messages/{message_id}
```

```json Response theme={null}
{
  "message_id": "5a9e6f1c-9e2f-4b1c-8a5c-7e8f9a0b1c2d",
  "wamid": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAEhg...",
  "status": "delivered",
  "type": "text",
  "created_at": "2026-07-14T18:22:04Z",
  "error": null
}
```

`status` here reflects WhatsApp's actual delivery lifecycle: `sent`, `delivered`, `read`, or `failed` (the `accepted` you get back from the POST just means Tanvik accepted the request — check this endpoint or the `message.status` webhook for what actually happened on the wire).

<Warning>
  Sending outside the 24-hour window fails with `send_failed` — the error `message` will say the session window is closed. Use [Send Templates](/whatsapp/send-templates) to re-open the conversation instead.
</Warning>

## Receiving messages

Inbound customer messages arrive as `message.received` webhook events, not through this endpoint — see the [Webhook](/whatsapp/webhook) page for the payload shape, and [Webhooks](/webhooks-overview) to register an endpoint.
