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

# REST API

> Send your first WhatsApp message using the REST API

## Prerequisites

To get the most out of this guide, you'll need to:

* Create a project API key in the Kapso dashboard under **Integrations → API keys**
* Connect a WhatsApp number under **WhatsApp → Phone numbers**

## 1. Get your credentials

Get your API key and phone number ID from the dashboard.

```bash theme={null} theme={null}
export KAPSO_API_KEY="your_api_key"
export PHONE_NUMBER_ID="your_phone_number_id"
```

## 2. Send a message

The easiest way to send a message is with a simple POST request.

```bash curl theme={null} theme={null}
curl -X POST https://api.kapso.ai/meta/whatsapp/${PHONE_NUMBER_ID}/messages \
  -H "X-API-Key: ${KAPSO_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "1234567890",
    "type": "text",
    "text": {
      "preview_url": false,
      "body": "Hello from Kapso!"
    }
  }'
```

## BSUID note

Use `to` when you have the customer's phone number. Use `recipient` when you only have a BSUID or parent BSUID.

```json theme={null}
{
  "messaging_product": "whatsapp",
  "recipient": "US.13491208655302741918",
  "type": "template",
  "template": {
    "name": "order_update",
    "language": {
      "code": "en_US"
    }
  }
}
```

Inbound payloads and read surfaces can expose BSUID fields and nullable phone identity. If you also consume webhooks or read message/conversation/contact payloads, see the migration guide:

* [Business-scoped user IDs](/docs/whatsapp/business-scoped-user-ids)

## 3. Try it yourself

<Card title="WhatsApp API reference" icon="arrow-up-right-from-square" href="/api-reference/whatsapp-api-overview">
  See all available endpoints.
</Card>
