> ## 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.

# Send text

> Send text messages via SDK or API

## Prerequisites

To send messages, 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**

## Send a text message

```typescript TypeScript SDK icon="square-js" theme={null}
import { WhatsAppClient } from '@kapso/whatsapp-cloud-api';

const client = new WhatsAppClient({
  baseUrl: 'https://api.kapso.ai/meta/whatsapp',
  kapsoApiKey: process.env.KAPSO_API_KEY!
});

await client.messages.sendText({
  phoneNumberId: '647015955153740',
  to: '15551234567',
  body: 'Hello! Your order #12345 has been shipped.'
});
```

```bash REST API icon="code" theme={null}
curl -X POST 'https://api.kapso.ai/meta/whatsapp/v24.0/647015955153740/messages' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "messaging_product": "whatsapp",
    "to": "15551234567",
    "type": "text",
    "text": {
      "body": "Hello! Your order #12345 has been shipped."
    }
  }'
```

## Send to a BSUID

Use `recipient` when you only have a BSUID or parent BSUID.

```bash REST API icon="code" theme={null}
curl -X POST 'https://api.kapso.ai/meta/whatsapp/v24.0/647015955153740/messages' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "recipient": "US.13491208655302741918",
    "type": "text",
    "text": {
      "body": "Hello! Your order #12345 has been shipped."
    }
  }'
```

Non-template messages still require an open 24-hour customer service window. Use an approved template to start or reopen a conversation.

See [business-scoped user IDs](https://docs.kapso.ai/docs/whatsapp/business-scoped-user-ids.md).


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