Send text
Send plain text messages and replies on WhatsApp.
Use text for everyday replies and short updates while the customer can still receive free-form messages.
At a glance
| Item | Detail |
|---|---|
type |
text |
| Channel support | Official and unofficial (matrix) |
| Body field | Prefer content.body; content.text (string or { "body": "..." }) is accepted for compatibility |
| URL preview | Set preview behavior in content when the body includes a URL (provider-dependent) |
| Reply | Optional content.reply_to.id and content.reply_to.participant |
Request body
| Field | Required | Description |
|---|---|---|
channel_id |
Yes | Sender channel ID |
to |
Yes | Recipient in international format (e.g. 6281234567890) |
type |
Yes | text |
content.body or content.text |
Yes | Message text |
Example
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": "Hello! Your order has been shipped."
}
}'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: "Hello! Your order has been shipped.",
}),
);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": "Hello! Your order has been shipped."},
},
timeout=30,
).raise_for_status()Quoted reply
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": "Thanks, we received your question.",
"reply_to": {
"id": "wamid.HBgL..."
}
}
}'await wazapin.messages.send(
textMessage({
channel_id: "wzp_abc123",
to: "6281234567890",
body: "Thanks, we received your question.",
reply_to: { id: "wamid.HBgL..." },
}),
);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": "Thanks, we received your question.",
"reply_to": {"id": "wamid.HBgL..."},
},
},
timeout=30,
).raise_for_status()