Your own software can send WhatsApp messages from a number that is connected to WizMessage, and hear about replies, deliveries and failures by webhook. The API speaks JSON over https. Every path on these pages starts with https://wizmessage.com/api/v1/external.
Before you start
- A WhatsApp Business number connected to WizMessage. A number can stay in the WhatsApp Business app on your phone at the same time, see coexistence.
- An active Wiz Bot or Wiz Pro plan. After a plan ends, the API keeps working for 7 days. See prices.
- An API key and its secret. The owner of the account makes them under API Management with Connect your software; both are shown once. The manual shows each screen.
- A server. The key and the secret belong there, never in a web page, a mobile app or a repository.
Send your first message
Put the key and the secret into the environment as WIZMESSAGE_API_KEY and WIZMESSAGE_API_SECRET. Write a WhatsApp message to your business from your own phone, then run one of these with your phone's number. +447700900123 is made up.
# bash quickstart.sh +447700900123 (needs curl and openssl)
BODY='{"to":"'"$1"'","message":"Your parcel is ready to collect.","reference":"order-1042"}'
TIMESTAMP=$(date +%s)
KEY=$(printf '%s' "$WIZMESSAGE_API_SECRET" | openssl dgst -sha256 -r | cut -d' ' -f1)
SIGNATURE=$(printf '%s' "$TIMESTAMP.$BODY" | openssl dgst -sha256 -hmac "$KEY" -r | cut -d' ' -f1)
curl -sS --max-time 70 -X POST https://wizmessage.com/api/v1/external/messages/text \
-H "X-API-Key: $WIZMESSAGE_API_KEY" \
-H "X-Timestamp: $TIMESTAMP" \
-H "X-API-Signature: $SIGNATURE" \
-H 'Content-Type: application/json' \
--data-binary "$BODY"// node --env-file=.env quickstart.mjs +447700900123 (Node.js 20 or newer)
import { createHash, createHmac } from 'node:crypto'
const body = JSON.stringify({
to: process.argv[2],
message: 'Your parcel is ready to collect.',
reference: 'order-1042',
})
const timestamp = Math.floor(Date.now() / 1000).toString()
const key = createHash('sha256').update(process.env.WIZMESSAGE_API_SECRET).digest('hex')
const signature = createHmac('sha256', key).update(`${timestamp}.${body}`).digest('hex')
const response = await fetch('https://wizmessage.com/api/v1/external/messages/text', {
method: 'POST',
headers: {
'X-API-Key': process.env.WIZMESSAGE_API_KEY,
'X-Timestamp': timestamp,
'X-API-Signature': signature,
'Content-Type': 'application/json',
},
body,
signal: AbortSignal.timeout(70_000),
})
console.log(response.status, await response.json())# python quickstart.py +447700900123 (Python 3.10 or newer)
import hashlib
import hmac
import json
import os
import sys
import time
import urllib.error
import urllib.request
body = json.dumps(
{
"to": sys.argv[1],
"message": "Your parcel is ready to collect.",
"reference": "order-1042",
}
).encode()
timestamp = str(int(time.time()))
key = hashlib.sha256(os.environ["WIZMESSAGE_API_SECRET"].encode()).hexdigest().encode()
signature = hmac.new(key, timestamp.encode() + b"." + body, hashlib.sha256).hexdigest()
request = urllib.request.Request(
"https://wizmessage.com/api/v1/external/messages/text",
data=body,
headers={
"X-API-Key": os.environ["WIZMESSAGE_API_KEY"],
"X-Timestamp": timestamp,
"X-API-Signature": signature,
"Content-Type": "application/json",
},
)
try:
with urllib.request.urlopen(request, timeout=70) as response:
print(response.status, json.load(response))
except urllib.error.HTTPError as error:
print(error.code, error.read().decode())<?php
// php quickstart.php +447700900123 (PHP 8.1 or newer with the curl extension)
$body = json_encode([
'to' => $argv[1],
'message' => 'Your parcel is ready to collect.',
'reference' => 'order-1042',
], JSON_THROW_ON_ERROR);
$timestamp = (string) time();
$key = hash('sha256', getenv('WIZMESSAGE_API_SECRET'));
$signature = hash_hmac('sha256', $timestamp . '.' . $body, $key);
$curl = curl_init('https://wizmessage.com/api/v1/external/messages/text');
curl_setopt_array($curl, [
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 70,
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . getenv('WIZMESSAGE_API_KEY'),
'X-Timestamp: ' . $timestamp,
'X-API-Signature: ' . $signature,
'Content-Type: application/json',
],
]);
$answer = curl_exec($curl);
echo curl_getinfo($curl, CURLINFO_RESPONSE_CODE), ' ', $answer, "\n";A free text arrives only within 24 hours of the last message from that person. After that, send an approved template.
{
"success": true,
"data": {
"message_id": "0b9d7c1e-2f4a-4c55-9a5e-6a1f0c2d3e4f",
"whatsapp_message_id": "wamid.EXAMPLE-SENT-1",
"status": "sent"
},
"meta": {
"request_id": "b1e6a2c4-1111-4222-8333-944455566677",
"rate_limit": {
"limit": 60,
"remaining": 59,
"reset_at": "2026-11-25T10:01:00.000Z"
}
}
}There are two ids in it. message_id is ours: look the message up with it. whatsapp_message_id is the one that webhooks carry later as data.message_id. sent means that WhatsApp accepted the message; a webhook tells you when it was delivered, read or refused.
Where to read on
| Page | What you find there |
|---|---|
| Authentication | Make a key, choose its permissions, sign a request, a small client in four languages |
| Send messages | Text, files, reply buttons, lists, contact cards, reactions, delivery status |
| Send templates | Start or reopen a conversation with an approved template and your own variable names |
| Webhooks | Receive messages and delivery reports, verify them, download files from customers |
All calls
| Call | What it does | Permission |
|---|---|---|
| POST /messages/text | Send a text message | send_text |
| POST /messages/media | Send a document, image, video or audio file | send_media |
| POST /messages/template/send | Send an approved template | send_template |
| POST /messages/template | Send an approved template with raw components | send_template |
| POST /messages/interactive/list | Send a list to choose from | send_text |
| POST /messages/interactive/button | Send up to three reply buttons | send_text |
| POST /messages/contacts | Send contact cards | send_text |
| POST /messages/reaction | React to a message with an emoji | send_text |
| GET /messages/{uuid} | Look up a message | any key |
| POST /media/upload | Upload a file | any key |
| GET /media/{media_id} | Download a file | view_messages |
| GET /templates | List templates | view_templates |
| GET /templates/{name} | Read one template | view_templates |
Limits
| Limit | Value | Note |
|---|---|---|
| Requests a minute | 60 | Per key; the owner can raise it to 1,000. |
| Requests a day | 1,000 | Per key, every call counts; the owner can raise it to 100,000. |
| Messages to one number a minute | 10 | Per key and recipient. |
| Speed of one WhatsApp number | about 15 a second | Shared with campaigns and the inbox. A call waits up to 30 seconds for its turn. |
| Client timeout | at least 65 seconds | There is no idempotency key: do not send again blindly after a timeout. |
| Document | 100 MB | Image 5 MB, video 16 MB, audio 16 MB. Downloads 32 MB. |
The answer of a send carries meta.rate_limit with what is left of the minute.
Errors
An error has the same outline on every call. details is there when there is more to say. Quote meta.request_id when you write to us.
{
"success": false,
"error": {
"code": "E_VALIDATION_ERROR",
"message": "Validation failure: to: The to field format is invalid",
"details": {
"to": [
"The to field format is invalid"
]
}
},
"meta": {
"request_id": "b1e6a2c4-1111-4222-8333-944455566677"
}
}- 400, 401, 403, 404, 413 and 422: something has to change first. The same call again gets the same answer.
- 429: wait, then try again. A code with
LIMITis ours;MESSAGE_SEND_FAILEDwith 429 means that WhatsApp slows the number down. - 500 and 502, or no answer at all: a message may be out already. Wait for the webhook with your
referencebefore you send it again.
| Status | Code | Meaning |
|---|---|---|
| 422 | E_VALIDATION_ERROR | A field is missing or wrong. details names each field. |
| 422 | VALIDATION_ERROR | The fields do not fit together, for example a caption on audio. |
| 401 | INVALID_API_KEY | The key is missing or unknown. |
| 401 | INVALID_SIGNATURE | The signature does not fit the body, or is missing on a key that needs it. |
| 401 | TIMESTAMP_EXPIRED | The timestamp is more than 5 minutes off. |
| 401 | EXPIRED_API_KEY | The key has passed its end date. |
| 401 | REVOKED_API_KEY | The key was revoked. |
| 401 | SUSPENDED_API_KEY | The key is switched off. |
| 403 | IP_NOT_ALLOWED | The key has an address list and this address is not on it. |
| 403 | PERMISSION_DENIED | The key lacks this permission. AI agent keys are always refused here. |
| 403 | SUBSCRIPTION_REQUIRED | No active Wiz Bot or Wiz Pro plan, and the 7 days of grace are over. |
| 403 | ACCOUNT_NOT_ACTIVE | The WhatsApp number of the key is not active. |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests this minute. details.retry_after says how many seconds to wait. |
| 429 | DAILY_LIMIT_EXCEEDED | The daily limit of the key is used up. |
| 422 | MESSAGE_SEND_FAILED | WhatsApp refused the message. With 429, WhatsApp slows the number down; with 500, something unexpected failed. |
| 404 | MESSAGE_NOT_FOUND | No such message for this key. |
| 404 | TEMPLATE_NOT_FOUND | No such template. |
| 400 | TEMPLATE_NOT_CONFIGURED | The template is not set up for this key in API Management. |
| 400 | INVALID_TEMPLATE_PARAMS | A variable of the template is missing or wrong. |
| 400 | INVALID_DATE_FORMAT | A date variable is not a date. |
| 400 | NO_FILE_PROVIDED | The upload has no file. |
| 400 | INVALID_FILE | The file is too large or of a kind that is not allowed. |
| 400 | UNSUPPORTED_FILE_TYPE | The kind of file could not be recognised. |
| 400 | FILE_TOO_LARGE | Larger than allowed for this kind of file. |
| 400 | INVALID_MIME_TYPE | The file does not fit the given media_type. |
| 500 | UPLOAD_FAILED | The upload to WhatsApp failed. |
| 500 | NO_MEDIA_ID | WhatsApp returned no media id. |
| 400 | INVALID_MEDIA_ID | Not a media id. |
| 404 | MEDIA_NOT_FOUND | Unknown, expired, or not of this account. |
| 413 | MEDIA_TOO_LARGE | Larger than 32 MB. |
| 502 | MEDIA_DOWNLOAD_FAILED | The file could not be fetched from WhatsApp. Worth another try. |
| 404 | COEXT_ACCOUNT_NOT_FOUND | The WhatsApp account of the key is gone. |
| 400 | COEXT_ACCOUNT_NOT_CONFIGURED | The WhatsApp account of the key is not ready. |
| 400 | PHONE_NUMBER_ID_MISSING | The WhatsApp account of the key has no number. |
| 400 | BUSINESS_TOKEN_MISSING | The WhatsApp account of the key must be connected again. |
| 500 | INTERNAL_ERROR | Something unexpected failed. |
What the API does not do
- It does not check the 24-hour window, and it does not check whether a customer unsubscribed. Your software has to know both.
- It has no idempotency key. Two equal calls send two messages. Give every send a
referenceof your own, and compare it with themessage.sentwebhook before you repeat anything. - It does not show its messages in the WizMessage inbox at the moment. Answers of customers do appear there.
- It cannot take a reaction back at the moment.
- One call sends one message to one person. For a list of people, use campaigns.
- It is not for AI agents. Keys of agents are refused here; they use the WizMessage MCP server, which has its own checks.
OpenAPI file
The whole API is described in one OpenAPI 3.1 file. Import it into your API client, or generate code from it. The tables on these pages are made from the same file.
Support
Write to [email protected] and add the request_id of the answer. Never send a key or a secret. If one may have been seen by somebody else, switch the key off in API Management at once and make a new one.
Trademarks
WhatsApp and Meta are trademarks of Meta Platforms, Inc. or its affiliates. Node.js, Python, PHP, curl, OpenAPI and other product names belong to their owners. They are used here only to say what WizMessage works with.
WizMessage is a product of Beth Technologies. It is not made, sponsored or endorsed by Meta, WhatsApp or any other company named here.