Developers
Send API & integrations
API keys, sending from your own code, and connecting DataMold and CalendarBook.
Your own systems — a shop, a booking system, a CRM — can send WhatsApp messages through Wago with an API key. A message sent this way lands in the same conversation your team reads in the console, labelled with the key's name, so an automatic order update and a colleague's reply sit in one thread in the order they happened.
API keys
- Open Settings → API Keys and create a key with a name that says what will use it — Shop orders, Booking reminders.
- Copy the key. It starts with
wago_and is shown exactly once. - Keep it on your server, never in a web page or an app a customer can download.
Send a message
POST /api/v1/send, with the key as an X-API-Key header (or as Authorization: Bearer wago_…) and a JSON body.
curl -X POST https://wago.crawlink.com/api/v1/send \
-H "X-API-Key: wago_your_key_here" \
-H "Content-Type: application/json" \
-d '{"to": "+91 98201 44718", "type": "text", "body": "Your order #4471 has shipped"}'const res = await fetch('https://wago.crawlink.com/api/v1/send', {
method: 'POST',
headers: {
'X-API-Key': process.env.WAGO_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({ to: '919820144718', type: 'text', body: 'Your OTP is 4821' })
});
const { data, message } = await res.json();
if (!res.ok) throw new Error(message);Body fields
| Field | Type | Meaning |
|---|---|---|
to | string | The number, in any format — spaces and + are stripped. A 10-digit number is taken as Indian. |
type | string | text (the default), template, image, video, document, audio, sticker or location. |
body | string | The words, or a media caption. Up to 4,096 characters. |
previewUrl | boolean | Show a preview of the first link in a text message. |
templateId | string | A template by its Wago id … |
templateName | string | … or by the name Meta approved. One of the two is required for type template. |
templateLanguage | string | The template’s language code, such as en or hi. |
params | string[] | Fills {{1}}, {{2}} … in order. Up to 20. |
url | string | For media: a public HTTPS link. WhatsApp fetches it itself. |
filename | string | For a document: the name the customer sees. |
latitude, longitude | number | For a location. |
locationName, address | string | For a location: its name and address. |
Sending a template
To reach someone who has not written in the last 24 hours, send an approved template:
{
"to": "919820144718",
"type": "template",
"templateName": "order_shipped",
"templateLanguage": "en",
"params": ["Ananya", "#4471"]
}The answer
A successful send answers 201:
{
"data": {
"to": "919820144718",
"messageId": "0192…",
"waMessageId": "wamid.HBgM…",
"status": "sent",
"type": "text"
},
"message": "Message sent successfully"
}The same rules as the console
- The 24-hour window. A template is delivered at once. Anything else sent to someone who has not written in the last 24 hours is queued and goes out when they next write — see the window.
- Metering. Each message uses one from the plan's allowance, then from top-ups.
- Which number. An existing conversation replies from its own number; a new one from the default number.
Errors
Every error has the same shape — { "data": {}, "message": "…" } — and a message a person can read.
| Status | Meaning |
|---|---|
400 | The body is not valid. The answer carries an issues list: each field, and what is wrong with it. |
401 | No key was sent, or the key is wrong or revoked. |
402 | The plan’s messages are used up and there are no top-ups left. |
503 | The organization has no WhatsApp number connected, or it was disconnected. |
Calling your API from a workflow
The other direction works too: a workflow's Call an API step reaches your server in the middle of a conversation — to look up an order, check a slot, create a lead — and branches on the answer.
DataMold
Settings → Integrations → DataMold connects your organization to a DataMold organization in a popup; no key is ever pasted or shown. Once connected, workflows gain a Save to DataMold step that saves what a conversation collected as a row in a DataMold table, or finds rows to answer from.
CalendarBook
Settings → Integrations → CalendarBook connects your organization to a CalendarBook organization the same way, in a popup. Workflows then gain a CalendarBook step that books an appointment, a table or a court from the chat — the contact picks a day and a time from WhatsApp lists — or finds and cancels their upcoming bookings. CalendarBook can also connect to Wago from its side, to send booking reminders as WhatsApp messages.