# Send your first message with the API

> Send one WhatsApp template with API v1, then read the status on the 201 response.

API v1 sends from the same WhatsApp Business numbers your team uses in Whatsable. This page sends one approved template to a number you control. API keys are on Pro and Agency, and during the 14-day trial. Create one under **API keys** in the sidebar. An agency creates that key inside the client organization: a key cannot read another organization's messages. See [API keys](/features/api-keys), [client organizations](/features/client-organizations#the-api-and-the-mcp-server) and [rate limits](/features/rate-limits).

## Send a template

`POST https://api.whatsable.app/v1/messages`

The body below is the template form of `SendMessageRequest` in the [OpenAPI file](/api-reference/openapi). Send `template.id`, or `template.name` together with `template.language`. Do not send both an id and a name. `Idempotency-Key` is optional. A repeat with the same key and the same body returns the stored response. A repeat with a different body returns `409 idempotency_key_reused`.

```bash
curl -sS -D - \
  -X POST "https://api.whatsable.app/v1/messages" \
  -H "Authorization: Bearer $WHATSABLE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: first-template-1" \
  -d '{
    "to": "+15551230001",
    "type": "template",
    "template": { "id": "TEMPLATE_ID" }
  }'
```

Replace `TEMPLATE_ID` with an approved template id from [List templates](/api-reference/v1/templates/list-templates). Use your own phone number in `to`. A template variable the template requires goes in `template.variables`, keyed by the variable name.

## Read the status

A `201` means Whatsable recorded the message. It does not mean WhatsApp accepted it. Read `status` on the body:

- `sent`: WhatsApp accepted it.
- `failed`, and the error is retryable: send again later with a new `Idempotency-Key`.
- `failed`, and the error is not retryable: do not resend. Read `error.how_to_fix`.

Outside the 24-hour window, only a template reaches the person. A text send then returns `422 session_window_closed`. A template is not limited by that window. The key must include `messages:send`. A key without it returns `403 insufficient_scope`.

## Guardrails

- Send the first one to your own number.
- Keep the API key in the `Authorization` header. Do not put it in the query string.
- Stay inside the [rate limits](/features/rate-limits). A limit answers `429 rate_limited`.
- Quote `request_id` from an error body if you ask for help. The response header `X-Request-Id` carries the same id.

- [Send a message](/api-reference/v1/messages/send-message): 
Text, media, buttons, and the full request.

- [API errors](/api/errors): 
Every error code and what to do about it.