Built and tested. The public service opens with the platform launch; until then API keys are not issued to customers.
Send a message
POST https://app.easytawasul.com/api/v1/messages
Rate limit: 120 requests per minute per key. The call returns 202 Accepted with the message object. Delivery results (delivered, read, failed) arrive later as webhooks, or read the message again.
The 24-hour rule
WhatsApp separates two situations:
Inside the customer service window. When a customer writes to you, a 24-hour window opens (and restarts with each new customer message). Inside it you may send free text.
Outside the window. You may only send an approved template. A text message returns 409 with code window_closed.
The rule is enforced by the platform, the same way as in the dashboard inbox.
Request fields
Field
Type
Required
Notes
to
string
yes
Recipient with country code, for example +201000000000. Spaces and dashes are removed.
type
string
yes
template or text
text.body
string
for text
Up to 4,096 characters
template.name
string
for template
Lowercase letters, digits and _ (as in the Templates page)
template.language
string
for template
For example ar, en, en_US
template.variables
array of strings
no
Fills {{1}}, {{2}} in order. Up to 20.
client_reference
string
no
Your own ID (order, user), up to 128 characters. Returned on the message and in status webhooks.
Header Idempotency-Key (1 to 64 letters, digits, ., _, -): send the same key again within 24 hours and you get the first message back (200, header Idempotent-Replayed: true) instead of a second send. Use it on every retry.
status moves forward only: queued, sent, delivered, read, or failed (then error has code and message).
Read messages
GET /v1/messages/{id}
GET /v1/messages?limit=25&to=201000000000&status=delivered&before=msg_81
Newest first. limit is 1 to 100. The list returns { "data": [...], "has_more": true, "next_before": "msg_60" }; pass next_before as before for the next page. Incoming messages appear with direction: "inbound".
Errors for this endpoint
Status
Code
Meaning
409
window_closed
Free text outside the 24-hour window. Send a template. The body has window_expired_at.
422
api.no_number
No connected WhatsApp number in the workspace
422
(validation)
A field is missing or malformed. The body lists the fields.
# Send a message
```http
POST https://app.easytawasul.com/api/v1/messages
```
Rate limit: 120 requests per minute per key. The call returns `202 Accepted` with the message object. Delivery results (`delivered`, `read`, `failed`) arrive later as [webhooks](webhooks), or read the message again.
## The 24-hour rule
WhatsApp separates two situations:
- **Inside the customer service window.** When a customer writes to you, a 24-hour window opens (and restarts with each new customer message). Inside it you may send free text.
- **Outside the window.** You may only send an **approved template**. A `text` message returns `409` with code `window_closed`.
The rule is enforced by the platform, the same way as in the dashboard inbox.
## Request fields
| Field | Type | Required | Notes |
|---|---|---|---|
| `to` | string | yes | Recipient with country code, for example `+201000000000`. Spaces and dashes are removed. |
| `type` | string | yes | `template` or `text` |
| `text.body` | string | for `text` | Up to 4,096 characters |
| `template.name` | string | for `template` | Lowercase letters, digits and `_` (as in the Templates page) |
| `template.language` | string | for `template` | For example `ar`, `en`, `en_US` |
| `template.variables` | array of strings | no | Fills `{{1}}`, `{{2}}` in order. Up to 20. |
| `client_reference` | string | no | Your own ID (order, user), up to 128 characters. Returned on the message and in status webhooks. |
Header `Idempotency-Key` (1 to 64 letters, digits, `.`, `_`, `-`): send the same key again within 24 hours and you get the first message back (`200`, header `Idempotent-Replayed: true`) instead of a second send. Use it on every retry.
### Template
```json
{
"to": "+201000000000",
"type": "template",
"template": { "name": "order_confirmation", "language": "ar", "variables": ["Mona", "1042"] }
}
```
### Text (inside the window only)
```json
{ "to": "+201000000000", "type": "text", "text": { "body": "Your order is on its way." } }
```
## The message object
```json
{
"id": "msg_81",
"direction": "outbound",
"to": "201000000000",
"from": null,
"type": "template",
"body": "Hello Mona, your order 1042 ...",
"status": "sent",
"error": null,
"client_reference": "order-1042",
"whatsapp_message_id": "wamid.HBg...",
"created_at": "2026-10-22T10:00:00+03:00"
}
```
`status` moves forward only: `queued`, `sent`, `delivered`, `read`, or `failed` (then `error` has `code` and `message`).
## Read messages
```http
GET /v1/messages/{id}
GET /v1/messages?limit=25&to=201000000000&status=delivered&before=msg_81
```
Newest first. `limit` is 1 to 100. The list returns `{ "data": [...], "has_more": true, "next_before": "msg_60" }`; pass `next_before` as `before` for the next page. Incoming messages appear with `direction: "inbound"`.
## Errors for this endpoint
| Status | Code | Meaning |
|---|---|---|
| 409 | `window_closed` | Free text outside the 24-hour window. Send a template. The body has `window_expired_at`. |
| 422 | `api.no_number` | No connected WhatsApp number in the workspace |
| 422 | (validation) | A field is missing or malformed. The body lists the fields. |
| 422 | `idempotency.invalid` | Bad `Idempotency-Key` format |
| 502 | `meta.rejected`, `meta.undeliverable`, `meta.rate_limited`, `meta.permission`, `meta.invalid_token`, `meta.unreachable` | Meta refused or could not be reached. The message is saved with status `failed`. |
All codes are listed in [Errors and limits](errors-and-limits).