Skip to main content
flag
Mon - Fri   10:00 – 18:00

Send Template

API Documentation / WhatsApp / Send Template

Base URL for your account: https://cpaas.studio

POST /api/whatsapp/v1/send/template

Send an approved template — the only way to start a conversation or write outside the 24-hour window. Authentication (OTP) templates take `code`.

Parameters

Param Type Required Notes
channel string if the key is not restricted Your number's uid.
to string yes Recipient phone.
template string yes Template name (see Templates).
language string yes Template language code, e.g. en, en_US, hi, ml.
variables.body string[] if the body has {{n}} Values for {{1}}, {{2}}, … in order. No newlines or tabs.
variables.header string[1] if the header has {{1}} The header variable.
variables.buttons object for URL / copy-code buttons {"0": "value"} — keyed by button position.
header_media string for image / video / document headers Media uid from your library (Upload Media).
code string, max 15 authentication templates The one-time password.

Request example

curl -X POST "https://cpaas.studio/api/whatsapp/v1/send/template" \
  -H "X-API-KEY: cpk_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Idempotency-Key: 6f1c2a9e-order-4471" \
  -H "Content-Type: application/json" \
  -d '{"channel":"WCH54DZ7M7M5V","to":"+919876543210","template":"order_update","language":"en","variables":{"body":["Asha","ORD-4471"]}}'

Success response (data)

{
    "message": {
        "ref": "1aB3-202610",
        "channel": "WCH54DZ7M7M5V",
        "to": "+919876543210",
        "type": "template",
        "category": "utility",
        "status": "queued",
        "billing": {
            "status": "billed",
            "amount": 0.115
        },
        "created_at": "2026-10-10T09:15:00+00:00"
    }
}

Errors

Code Status When
WA_TEMPLATE_NOT_FOUND 404 No template with that name and language on the number's WhatsApp Business Account.
WA_TEMPLATE_NOT_APPROVED 422 The template is in review, rejected, paused, disabled or removed (error.details.status).
WA_RECIPIENT_EXCLUDED 422 The number opted out, is blacklisted, is not on WhatsApp, or is a username-only contact (error.details.reason). Nothing is charged.
WA_CHANNEL_UNAVAILABLE 422 The number is disabled, restricted or disconnected.
BILLING_NO_ACTIVE_PLAN 402 No active WhatsApp plan.
WA_CATEGORY_DISABLED 402 The message's category is not on your plan.
BILLING_PLAN_QUOTA_EXHAUSTED 402 The category allowance and the shared allowance are used up.
REQ_IDEMPOTENCY_KEY_CONFLICT 409 The Idempotency-Key was used with a different body (or that request is still being processed).
REQ_VALIDATION_FAILED 422 A field is missing or invalid (error.fields), including a number that is not a valid WhatsApp number.

Notes

  • 202 Accepted means recorded, charged and queued — not delivered. The message is sent by our worker within your number's messages-per-second limit; follow it with Message Status or the status webhook.
  • Idempotency-Key header (recommended): the same key within 24 hours returns the original response (header Idempotent-Replayed: true) and sends nothing. A different body under the same key is 409.
  • to: a phone number in international format; a 10-digit Indian mobile, 0 + 10 digits and +91 forms are all accepted. A number that is not yet a contact becomes one (your API terms cover the opt-in).
  • channel: the uid of one of your numbers (Channels). Optional when the API key is restricted to one number.
  • Rate limit: 6,000 requests per minute per account by default (all your keys share it; ask us to raise it). Above it: HTTP 429 SYS_RATE_LIMITED with a Retry-After header. Sends are additionally paced by each number's messages-per-second limit after acceptance.

Need more context? See Getting started for authentication, the response envelope, and the full error-code reference.