home / skills / openclaw / skills / whatsapp-business
This skill helps you send WhatsApp messages via Cloud API, including text, templates, images, and interactive buttons to customers.
npx playbooks add skill openclaw/skills --skill whatsapp-businessReview the files below or copy the command above to add this skill to your agents.
---
name: whatsapp-business
description: Send messages via WhatsApp Business Cloud API. Send templates, media, and interactive messages to customers.
metadata: {"clawdbot":{"emoji":"💬","requires":{"env":["WHATSAPP_TOKEN","WHATSAPP_PHONE_ID"]}}}
---
# WhatsApp Business Cloud API
Business messaging on WhatsApp.
## Environment
```bash
export WHATSAPP_TOKEN="xxxxxxxxxx"
export WHATSAPP_PHONE_ID="xxxxxxxxxx"
```
## Send Text Message
```bash
curl -X POST "https://graph.facebook.com/v18.0/$WHATSAPP_PHONE_ID/messages" \
-H "Authorization: Bearer $WHATSAPP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "1234567890",
"type": "text",
"text": {"body": "Hello from WhatsApp Business!"}
}'
```
## Send Template Message
```bash
curl -X POST "https://graph.facebook.com/v18.0/$WHATSAPP_PHONE_ID/messages" \
-H "Authorization: Bearer $WHATSAPP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "1234567890",
"type": "template",
"template": {
"name": "hello_world",
"language": {"code": "en_US"}
}
}'
```
## Send Image
```bash
curl -X POST "https://graph.facebook.com/v18.0/$WHATSAPP_PHONE_ID/messages" \
-H "Authorization: Bearer $WHATSAPP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "1234567890",
"type": "image",
"image": {"link": "https://example.com/image.jpg"}
}'
```
## Send Interactive Buttons
```bash
curl -X POST "https://graph.facebook.com/v18.0/$WHATSAPP_PHONE_ID/messages" \
-H "Authorization: Bearer $WHATSAPP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "1234567890",
"type": "interactive",
"interactive": {
"type": "button",
"body": {"text": "Choose an option:"},
"action": {
"buttons": [
{"type": "reply", "reply": {"id": "yes", "title": "Yes"}},
{"type": "reply", "reply": {"id": "no", "title": "No"}}
]
}
}
}'
```
## Get Message Templates
```bash
curl "https://graph.facebook.com/v18.0/{WABA_ID}/message_templates" \
-H "Authorization: Bearer $WHATSAPP_TOKEN"
```
## Links
- Console: https://business.facebook.com/wa/manage/home
- Docs: https://developers.facebook.com/docs/whatsapp/cloud-api
This skill sends messages using the WhatsApp Business Cloud API, enabling programmatic delivery of text, templates, media, and interactive messages to customers. It includes examples for text, template, image, and interactive button payloads and shows how to list registered message templates. Environment variables store the API token and phone ID for secure requests.
The skill constructs HTTPS POST requests to the Facebook Graph API endpoint for your WhatsApp Business phone number. It uses an authorization bearer token and JSON payloads to specify messaging_product, recipient, message type (text, template, image, interactive), and message-specific fields like body, template name, or media link. Templates and templates listing use dedicated endpoints and require pre-approved template names and languages.
What environment variables are required?
Set WHATSAPP_TOKEN (API bearer token) and WHATSAPP_PHONE_ID (your WhatsApp Business phone object ID).
How do I send an image?
Send a POST to the messages endpoint with type 'image' and include an image.link pointing to a public HTTPS URL.