Skip to main content

Send a WhatsApp Message

POST/v1/whatsapp
Send a WhatsApp message to a phone number. Supports both template messages (business-initiated, pre-approved) and chat messages (within 24h customer care window).

Request Body

to
string
required
Recipient phone number in international format (e.g., +919876543210). Must be at least 10 digits.
type
string
required
Message type. One of template or chat.
templateName
string
Template name (required when type is template). Must be a pre-approved template in Meta Business Manager.
language
string
Template language code. Default: en_US.
variables
string[]
Template variable values in order (e.g., ["John", "ORD-123"] for {{1}}, {{2}}).
message
string
Chat message text (required when type is chat).

Template Message Example

cURL
curl -X POST https://www.unosend.co/api/v1/whatsapp \
  -H "Authorization: Bearer un_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "type": "template",
    "templateName": "order_update",
    "language": "en_US",
    "variables": ["John", "ORD-123"]
  }'

Chat Message Example

cURL
curl -X POST https://www.unosend.co/api/v1/whatsapp \
  -H "Authorization: Bearer un_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "type": "chat",
    "message": "Hello! Your order has been shipped."
  }'

Response

200 OK
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "to": "+919876543210",
    "status": "sent",
    "message_id": "wamid.abc123..."
  }
}

Error Response

402 Payment Required
{
  "error": "Insufficient balance for WhatsApp message"
}
WhatsApp messages are billed from your wallet. You get 20 free lifetime messages, then each message costs $0.05 from your wallet balance.
Chat messages can only be sent within 24 hours of the user’s last incoming message (WhatsApp policy). Template messages can be sent anytime but must be pre-approved by Meta.