Sendly
Start free
Developer Docs

WhatsApp API

Send WhatsApp messages from your own systems using your connected WhatsApp Business Account. Authenticate with an API key; messages are queued and delivered asynchronously.

Overview

Base URLhttps://app.sendly.ge/api/v1
AuthAuthorization: Bearer wa_live_…
Content-Typeapplication/json

Get your credentials

A connected WhatsApp Business Account and an API key are both needed before you can send.

WhatWhere it comes fromPurpose
wa_live_… API key Dashboard → WhatsApp → API Keys, or POST /api/v1/whatsapp/keys Authenticates your requests. Shown once at creation — store it securely.
WhatsApp Business Account Connected from the WhatsApp settings page Messages send from your account’s phone number. Name one explicitly with phoneNumberId if you have more than one.

To revoke a key, delete it on the API Keys page or call DELETE /api/v1/whatsapp/keys/:id; requests using it immediately return 401.

Send a message

POST /api/v1/whatsapp/messages

One endpoint handles both template and free-form sends. It answers 202 Accepted with the queued message id; delivery happens in the background.

Body parameters

FieldTypeRequiredDescription
typestring✅template or text. See the 24-hour rule below.
tostring✅Recipient in international format, e.g. 995555123456.
textstringfor textMessage body. Only allowed inside the 24-hour window.
templateNamestringfor templateName of a template Meta has approved.
templateLanguagestringfor templateMust match the approved language exactly, e.g. en_US.
componentsarrayoptionalTemplate variables. The number of body parameters must match the template.
phoneNumberIdstringoptionalSend from a specific number. Omit if your account has one.

Response — 202 Accepted

json
{
  "id": "clx9a8b7c6d5e4f3g2h1",
  "status": "QUEUED"
}

The id correlates to a row in the dashboard inbox, where you can watch the status transition.

The 24-hour rule

This is WhatsApp’s rule, not Sendly’s, and it decides which of the two send types you may use.

SituationWhat you may send
The person has not messaged you in the last 24 hoursAn approved template only (type: "template")
Within 24 hours of their last messageFree-form text (type: "text") or a template
bash
curl -X POST https://app.sendly.ge/api/v1/whatsapp/messages \
  -H "Authorization: Bearer wa_live_xxxx..." \
  -H "Content-Type: application/json" \
  -d '{
    "type": "text",
    "to": "995555123456",
    "text": "See you at 15:00."
  }'

Examples

Appointment reminder (curl)

bash
curl -X POST https://app.sendly.ge/api/v1/whatsapp/messages \
  -H "Authorization: Bearer wa_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "template",
    "to": "995555123456",
    "templateName": "confirmation",
    "templateLanguage": "en_US",
    "components": [
      { "type": "body", "parameters": [{ "type": "text", "text": "Nino" }] }
    ]
  }'

Node.js

javascript
const res = await fetch("https://app.sendly.ge/api/v1/whatsapp/messages", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SENDLY_WA_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    type: "template",
    to: "995555123456",
    templateName: "confirmation",
    templateLanguage: "en_US",
    components: [
      { type: "body", parameters: [{ type: "text", text: "Nino" }] },
    ],
  }),
});

if (!res.ok) {
  throw new Error(`WhatsApp send failed: ${res.status} ${await res.text()}`);
}
const { id, status } = await res.json();
console.log(`Queued ${id} (${status})`);

Errors

StatusMeaning
401Missing, malformed or revoked API key.
400Invalid body — commonly a template name or language that does not match an approved template, or the wrong number of body variables.
403Free-form text attempted outside the 24-hour window. Send a template instead.
404No active WhatsApp number, or a phoneNumberId that does not belong to your organization.
429Above your number’s WhatsApp messaging tier. Retry with backoff.

A 202 followed by a FAILED message usually means Meta rejected the send. The reason is on the message record — most often a template that is not approved, or a language mismatch.

Data retention

Conversations and sent messages are kept for the life of your account and stay visible in the inbox.

Scheduled booking reminders are the exception: finished reminders are kept for 14 days and then removed automatically. See the Alteg.io integration guide for exactly what that covers.