Messages API
Send one approved template to one person, list messages, check a message's status and look up what a failure code means.
/v1/messages#Send a template message
Sends one APPROVED WhatsApp template to one person, starting a new message. Give contact_id or a phone. Check placeholders with GET /v1/templates/{template_name}/{language_code}: variables fill body placeholders in order, NAMED ones too, and a header variable needs header_variable. Refuses unsubscribed contacts (CONTACT_OPTED_OUT). For an existing chat use POST /v1/chats/{chat_id}/reply-template; for many people use POST /v1/broadcasts. Reaches a real phone and is billed.
Permission: messages:change
Body parameters (7)
contact_idstring
A CRM contact. Give this, or country_code and phone.country_codestring
Country calling code digits only, e.g.91.phonestring
Local number, without the country code.template_namerequiredstring
An APPROVED template's name from GET /v1/templates.language_coderequiredstring
The template's language code, e.g.en_US.variablesstring[]
Body placeholder values in order; the count must match the template's placeholders.Default[]header_variablestring
Value for the template's header variable. Required when the header has one.
curl -X POST "https://backend.sheetwa.com/v1/messages" \
-H "Authorization: Bearer $SHEETWA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"country_code": "91",
"phone": "9876543210",
"template_name": "order_update",
"language_code": "en",
"variables": [
"Asha",
"#1042"
]
}'/v1/messages#List messages by day
Every WhatsApp message on a day or a short range, from all chats at once, grouped by chat with contact name, phone and who wrote each message (sender_kind). Use for 'show me today's chats'; filter with sender_kinds, e.g. ["customer"] for what customers wrote. For one customer's history use GET /v1/chats/{chat_id}/messages.
Permission: inbox:view
Query parameters (7)
datestring
One day intimezone:today,yesterdayor a date like2026-10-05. Defaulttoday.from_datestring
Start of a range, inclusive. Give withto_dateinstead ofdate; at most 7 days.to_datestring
End of a range, inclusive.sender_kinds"customer" | "team_member" | "phone" | "ai_agent" | "api" | "auto_reply" | "lifecycle_message" | "broadcast" | "chatbot" | "chatbot_reminder" | "system"[]
Only messages written by these: customer, team_member, phone, ai_agent, api, auto_reply, lifecycle_message, broadcast, chatbot, chatbot_reminder, system.timezonestring
IANA timezone for the dates and the times shown, e.g.Asia/Kolkata. Default: the workspace's timezone, else Asia/Kolkata.cursorstring
next_cursorfrom the previous page; omit for the first page. Keep the other filters the same; the page size stays as on the first page.page_sizeinteger
Messages per page, 1-200. Default 100.Default100
curl "https://backend.sheetwa.com/v1/messages?page_size=20" \
-H "Authorization: Bearer $SHEETWA_API_KEY"/v1/messages/{message_id}#Get a message's delivery status
Delivery status of one sent WhatsApp message (queued, sent, delivered, read, failed) with Meta's error when it failed.
Permission: messages:view
Path parameters (1)
message_idrequiredstring
Themessage_ida send or reply returned.
curl "https://backend.sheetwa.com/v1/messages/MESSAGE_ID" \
-H "Authorization: Bearer $SHEETWA_API_KEY"/v1/errors/{code}#Explain a failure code
What a WhatsApp failure code means and what fixes it, in the dashboard's words.
Permission: broadcasts:view
Path parameters (1)
coderequiredstring
The failure code, e.g.131049.
curl "https://backend.sheetwa.com/v1/errors/131049" \
-H "Authorization: Bearer $SHEETWA_API_KEY"