# Send a WhatsApp message with an API: Cloud API and SuperSkope examples

How to send a WhatsApp message with an API: curl examples for Meta’s Cloud API and SuperSkope, the 24-hour rule, error codes and idempotent retries.

Canonical URL: https://superskope.com/blog/whatsapp-api-send-message
Updated: 2026-11-27
Author: SuperSkope

## Short answer

On Meta’s official Cloud API, send a POST to /<PHONE_NUMBER_ID>/messages with a bearer token: use an approved template to start a conversation, and free-form text only within 24 hours of the customer’s last message.

On SuperSkope’s linked-device API, POST text to /api/v1/chats/{chatId}/messages with an Idempotency-Key so a retry can never send twice.

## Which API are you sending through?

The request looks similar everywhere: an HTTPS POST with a bearer token and a JSON body. What differs is what you are allowed to send. On Meta’s official Cloud API, a message to someone who has not written to you in the last 24 hours must be an approved template. On a linked-device API such as SuperSkope, you send as your existing number into chats and groups it already belongs to, under WhatsApp’s normal rules for personal accounts.

Both examples below are labelled. The official examples use Meta’s Cloud API at graph.facebook.com. The SuperSkope examples use SuperSkope’s customer API at api.superskope.com, which is not Meta’s platform.

## Official Cloud API: send a template message

Use a template to start a conversation or to message someone outside the 24-hour window. Every new app has the approved hello_world template, which is enough to test. Replace the phone number ID and token with your own from the App Dashboard.

```
# Official WhatsApp Cloud API (Meta)
curl "https://graph.facebook.com/v27.0/$PHONE_NUMBER_ID/messages" \
  -H "Authorization: Bearer $WHATSAPP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "+910000000099",
    "type": "template",
    "template": {
      "name": "order_update",
      "language": { "code": "en" },
      "components": [{
        "type": "body",
        "parameters": [{ "type": "text", "text": "48213" }]
      }]
    }
  }'
```

Copy-only example. No request is run by this page.

## Official Cloud API: reply with a text message

Inside an open customer service window you can send a free-form text, image, document or interactive message. The response contains a message ID starting with “wamid.”. That only means Meta accepted the request. Whether it was delivered and read arrives later as a status webhook.

```
# Official WhatsApp Cloud API (Meta), inside the 24-hour window
curl "https://graph.facebook.com/v27.0/$PHONE_NUMBER_ID/messages" \
  -H "Authorization: Bearer $WHATSAPP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "to": "+910000000099",
    "type": "text",
    "text": { "body": "Your order 48213 has left our Pune warehouse." }
  }'
```

Copy-only example. No request is run by this page.

- [WhatsApp message templates and the 24-hour window](https://superskope.com/blog/whatsapp-message-templates)

## SuperSkope API: send a text to an existing chat

SuperSkope addresses conversations by chat ID, which you get from the chats list or an event. Never build a chat ID from a phone number. Each send needs an Idempotency-Key header of 8 to 128 letters, digits, underscores or hyphens that identifies one intended message. The key in this example only allows sending to conversations the owner selected for it.

```
# SuperSkope customer API (linked device, not Meta's platform)
curl "https://api.superskope.com/api/v1/chats/$CHAT_ID/messages" \
  -H "Authorization: Bearer $SUPERSKOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-48213-dispatched" \
  -d '{ "type": "text", "text": "Your order 48213 has left our Pune warehouse." }'
```

Copy-only example. No request is run by this page.

## SuperSkope API: start a chat with a phone number

To message a number the linked account has not chatted with yet, use the start-chat endpoint with the full international number and the first text. It needs both the chats:create and messages:write permissions. Starting chats with people who do not expect you is cold outreach, which WhatsApp prohibits, so use it for customers who asked to be contacted.

```
# SuperSkope customer API
curl "https://api.superskope.com/api/v1/chats" \
  -H "Authorization: Bearer $SUPERSKOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: callback-request-7731" \
  -d '{ "phoneNumber": "+910000000099", "text": "Hi, this is the support team. You asked us to call back about booking 7731." }'
```

Copy-only example. No request is run by this page.

## The same send with the SuperSkope Node.js SDK

The server SDK wraps the same endpoints. It never retries a write on its own. A result of state “sent” means WhatsApp accepted the message; “unknown” means stop and inspect before doing anything else.

```
import { SuperSkope } from '@superskope/sdk';

const client = new SuperSkope({
  origin: 'https://api.superskope.com',
  apiKey: process.env.SUPERSKOPE_API_KEY,
});

// Save this key with the business event before calling, and reuse it on any retry.
const requestKey = 'order-48213-dispatched';
const result = await client.sendText(chatId, 'Your order 48213 has left our Pune warehouse.', {
  idempotencyKey: requestKey,
});
if (result.state !== 'sent') {
  // Do not send again. Look up what happened to the original request.
  console.log(await client.requestState(requestKey));
}
```

Copy-only example. No request is run by this page.

- [WhatsApp API in Node.js and TypeScript](https://superskope.com/blog/whatsapp-api-nodejs)

## Why idempotency matters for WhatsApp sends

Networks fail in the worst place: after the platform accepted your message but before your code saw the response. If your code then retries blindly, the customer gets the same message twice. An idempotency key tied to the business event, such as an order ID plus a stage, turns a retry into a lookup.

SuperSkope stores the key with a hash of the request. An identical repeat returns the saved result instead of sending again; a different body with the same key is rejected. A send interrupted by a restart becomes unknown and is never submitted automatically. Meta’s Cloud API does not take an idempotency header, so keep your own record of business event to wamid before you send, and check status webhooks before resending.

- [Accepted, delivered and read are different message states](https://superskope.com/blog/whatsapp-message-statuses)
- [Handle webhook retries without duplicate replies](https://superskope.com/blog/webhook-retries-without-duplicates)

## Common errors when sending WhatsApp messages



| Error | Where | What it means | What to do |
| --- | --- | --- | --- |
| 131056 | Cloud API | Too many messages to the same user (pair rate limit) | Wait; Meta suggests backing off 4^n seconds |
| 130429 | Cloud API | Throughput limit for the number exceeded | Queue and slow down to under your messages-per-second level |
| 131049 | Cloud API (status webhook) | Per-user marketing limit reached | Wait at least 24 hours before resending that marketing template |
| Template not allowed outside window | Cloud API | Free-form message sent with no open customer service window | Send an approved template instead |
| 409 idempotency conflict | SuperSkope | Same key reused with a different body | Use a new key only for a genuinely new message |
| state: unknown | SuperSkope | The send outcome is not confirmed | Check the request state and the chat before any new send |

## Is there a free API to send WhatsApp messages?

Meta’s API access is free and replies inside the 24-hour window are free for the first 1,000 a month per number, but templates are charged. Open-source libraries that drive WhatsApp Web are free to run, but they are unofficial and break WhatsApp’s terms when used for automated or bulk sending.

> WhatsApp’s Terms of Service prohibit bulk, automated and non-personal messaging without WhatsApp’s authorisation, and unofficial clients can lead to restrictions or a ban. Use a linked-device API for replies, operations and groups you already run, never for cold outreach or broadcasts.

- [Is the WhatsApp API free?](https://superskope.com/blog/is-whatsapp-api-free)
- [Is an unofficial WhatsApp API safe?](https://superskope.com/blog/unofficial-whatsapp-api)

## Next step

Send the hello_world template from Meta’s test number to your own phone, reply to it, then send a free-form text inside the window. That one round trip exercises tokens, templates, the 24-hour rule and webhooks. If your work is in existing groups and chats instead, create a SuperSkope key with read permissions first, list your chats, and add messages:write only when your approval flow is ready.

- [WhatsApp webhooks: setup, signatures and retries](https://superskope.com/blog/whatsapp-webhook-guide)
- [The SuperSkope WhatsApp API](https://superskope.com/whatsapp-api)
- [Read the developer documentation](https://docs.superskope.com/)

## Frequently asked questions

**Can I send a WhatsApp message to any number with the API?** On the official Cloud API, only to people who opted in to hear from your business, and only with a template if they have not messaged you in 24 hours. On a linked-device API you can technically message any WhatsApp number, but messaging people who do not expect you breaks WhatsApp’s terms and gets numbers restricted.

**How do I know if my WhatsApp API message was delivered?** Not from the send response. Meta returns a wamid when it accepts the request, then sends sent, delivered, read or failed statuses to your webhook. SuperSkope returns state sent when WhatsApp accepts it and reports receipts as separate events. Receipts can be missing if the recipient turned them off.

**Can I send WhatsApp messages to a group with the API?** With Meta’s Cloud API, only to groups created through its Groups API, which hold up to 8 participants and are billed per delivered member. With SuperSkope you can send to existing groups your linked number belongs to, using the same messages endpoint with the group’s chat ID and a key scoped to that group.

**How many WhatsApp messages can I send per second with the API?** Meta’s Cloud API allows 80 messages per second per number by default, upgradable to 1,000, within your daily messaging limit. SuperSkope deliberately limits each API key to 10 writes a minute and 1,000 a day by default, and the hub to ten sends a minute, because linked-device numbers are not built for volume.

## Sources



- [Meta: Send messages and customer service windows](https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/send-messages)
- [Meta: Cloud API get started](https://developers.facebook.com/documentation/business-messaging/whatsapp/get-started)
- [Meta: Template fundamentals](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/overview)
- [Meta: About the WhatsApp Business Platform (rate limits)](https://developers.facebook.com/documentation/business-messaging/whatsapp/about-the-platform)
- [Meta: Throughput](https://developers.facebook.com/documentation/business-messaging/whatsapp/throughput)
- [Meta: Per-user marketing template limits](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/marketing-templates/per-user-limits)
- [WhatsApp Terms of Service](https://www.whatsapp.com/legal/terms-of-service)
- [WhatsApp Help Center: bulk and automated messaging](https://faq.whatsapp.com/5957850900902049)

## Continue reading

- [Accepted, delivered and read are different message states.](https://superskope.com/blog/whatsapp-message-statuses)
- [Handle WhatsApp webhook retries without duplicate replies.](https://superskope.com/blog/webhook-retries-without-duplicates)
- [WhatsApp Cloud API explained: setup, limits, groups and pricing](https://superskope.com/blog/whatsapp-cloud-api)
- [A WhatsApp API for the system you want to build.](https://superskope.com/whatsapp-api)
