---
title: "Example: send a text message"
description: "Notify a customer with a plain text WhatsApp message, end to end."
---

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

# Example: send a text message

1. **Get your API key**

   Create a key in the [dashboard](https://app.wazapin.com) or with `POST /v1/api-keys`. See [Authentication](/api/authentication).

2. **Choose channel and recipient**

   Use your connected `channel_id` and the customer's phone number in international format (for example `6281234567890`).

3. **Send the message**

### cURL

```bash
curl -X POST "https://api.wazapin.com/v1/messages" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
"channel_id": "wzp_abc123",
"to": "6281234567890",
"type": "text",
"content": {"body": "Your order is on the way!"}
  }'
```
### TypeScript

```typescript
import { WazapinClient, textMessage } from "@wazapin/sdk";

const wazapin = new WazapinClient({ apiKey: process.env.WAZAPIN_API_KEY! });

await wazapin.messages.send(
  textMessage({
channel_id: "wzp_abc123",
to: "6281234567890",
body: "Your order is on the way!",
  }),
);
```
### Python

```python
import requests

requests.post(
"https://api.wazapin.com/v1/messages",
headers={"X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={
    "channel_id": "wzp_abc123",
    "to": "6281234567890",
    "type": "text",
    "content": {"body": "Your order is on the way!"},
},
timeout=30,
).raise_for_status()
```

4. **Check message status**

   Use returned `id` to query message state.

### cURL

```bash
curl -X GET "https://api.wazapin.com/v1/messages/{messageID}" \
  -H "X-Api-Key: YOUR_API_KEY"
```
### TypeScript

```typescript
import { WazapinClient } from "@wazapin/sdk";

const wazapin = new WazapinClient({ apiKey: process.env.WAZAPIN_API_KEY! });

const { data: message } = await wazapin.messages.get("{messageID}");
console.log(message.status);
```
### Python

```python
import requests

response = requests.get(
"https://api.wazapin.com/v1/messages/{messageID}",
headers={"X-Api-Key": "YOUR_API_KEY"},
timeout=30,
)
response.raise_for_status()
print(response.json())
```

Source: https://docs.wazapin.id/recipes/send-text-message/index.mdx
