Messages
4 endpoints

Messages API

Send one approved template to one person, list messages, check a message's status and look up what a failure code means.

Badges:
Read onlyWrites dataSends to WhatsAppDestructive
POST/v1/messages#

Send a template message

Sends to WhatsApp

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_id

    string

    A CRM contact. Give this, or country_code and phone.
  • country_code

    string

    Country calling code digits only, e.g. 91.
  • phone

    string

    Local number, without the country code.
  • template_namerequired

    string

    An APPROVED template's name from GET /v1/templates.
  • language_coderequired

    string

    The template's language code, e.g. en_US.
  • variables

    string[]

    Body placeholder values in order; the count must match the template's placeholders.Default []
  • header_variable

    string

    Value for the template's header variable. Required when the header has one.
bashPOST /v1/messages
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"
    ]
  }'
GET/v1/messages#

List messages by day

Read only

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)

  • date

    string

    One day in timezone: today, yesterday or a date like 2026-10-05. Default today.
  • from_date

    string

    Start of a range, inclusive. Give with to_date instead of date; at most 7 days.
  • to_date

    string

    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.
  • timezone

    string

    IANA timezone for the dates and the times shown, e.g. Asia/Kolkata. Default: the workspace's timezone, else Asia/Kolkata.
  • cursor

    string

    next_cursor from the previous page; omit for the first page. Keep the other filters the same; the page size stays as on the first page.
  • page_size

    integer

    Messages per page, 1-200. Default 100.Default 100
bashGET /v1/messages
curl "https://backend.sheetwa.com/v1/messages?page_size=20" \
  -H "Authorization: Bearer $SHEETWA_API_KEY"
GET/v1/messages/{message_id}#

Get a message's delivery status

Read only

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_idrequired

    string

    The message_id a send or reply returned.
bashGET /v1/messages/{message_id}
curl "https://backend.sheetwa.com/v1/messages/MESSAGE_ID" \
  -H "Authorization: Bearer $SHEETWA_API_KEY"
GET/v1/errors/{code}#

Explain a failure code

Read only

What a WhatsApp failure code means and what fixes it, in the dashboard's words.

Permission: broadcasts:view

Path parameters (1)

  • coderequired

    string

    The failure code, e.g. 131049.
bashGET /v1/errors/{code}
curl "https://backend.sheetwa.com/v1/errors/131049" \
  -H "Authorization: Bearer $SHEETWA_API_KEY"