Developers · WhatsApp

WhatsApp API Reference

Send WhatsApp messages through the official WhatsApp Business Platform using your SMSID account — template messages to open conversations, and free-text replies inside the 24-hour window.

Authentication

Use the same SMSID secret API key as the SMS API, sent in the X-Api-Key header over HTTPS. WhatsApp messages are charged against the same prepaid balance.

Base URL
https://smsid.co.uk/api/v1
Sign in to see your key inserted into the examples.
WhatsApp requires a verified WhatsApp Business Account and approved message templates. Contact us to provision your business number and templates before sending.

Send template message

POST/whatsapp/send

Template messages are used to start a conversation (outside the 24-hour window). The template must be pre-approved.

FieldTypeDescription
type requiredstringSet to template.
to requiredstringRecipient in international format, e.g. +447700900123
template requiredstringApproved template name.
language optionalstringLanguage code (default en).
params optionalarrayOrdered values for the template body placeholders.
Request
curl -X POST https://smsid.co.uk/api/v1/whatsapp/send \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "template", "to": "+447700900123", "template": "welcome", "language": "en", "params": ["Ahmed"]}'
<?php
$ch = curl_init("https://smsid.co.uk/api/v1/whatsapp/send");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => ["X-Api-Key: YOUR_API_KEY", "Content-Type: application/json"],
    CURLOPT_POSTFIELDS     => json_encode([
        "type"     => "template",
        "to"       => "+447700900123",
        "template" => "welcome",
        "language" => "en",
        "params"   => ["Ahmed"],
    ]),
]);
echo curl_exec($ch);
import requests

resp = requests.post(
    "https://smsid.co.uk/api/v1/whatsapp/send",
    headers={"X-Api-Key": "YOUR_API_KEY"},
    json={
        "type": "template",
        "to": "+447700900123",
        "template": "welcome",
        "language": "en",
        "params": ["Ahmed"],
    },
)
print(resp.json())
const res = await fetch("https://smsid.co.uk/api/v1/whatsapp/send", {
  method: "POST",
  headers: { "X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    type: "template",
    to: "+447700900123",
    template: "welcome",
    language: "en",
    params: ["Ahmed"],
  }),
});
console.log(await res.json());
Response
{
  "meta": { "code": 200, "text": "OK" },
  "data": { "status": "queued", "message_id": "1aU6cwxAKE9...", "cost": "0.0500" }
}

Send text message

POST/whatsapp/send

Free-text messages can only be sent within 24 hours of the customer's last message (the customer-care window).

curl -X POST https://smsid.co.uk/api/v1/whatsapp/send \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "text", "to": "+447700900123", "message": "Hello from SMSID"}'
<?php
$ch = curl_init("https://smsid.co.uk/api/v1/whatsapp/send");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => ["X-Api-Key: YOUR_API_KEY", "Content-Type: application/json"],
    CURLOPT_POSTFIELDS     => json_encode([
        "type"    => "text",
        "to"      => "+447700900123",
        "message" => "Hello from SMSID",
    ]),
]);
echo curl_exec($ch);
import requests

resp = requests.post(
    "https://smsid.co.uk/api/v1/whatsapp/send",
    headers={"X-Api-Key": "YOUR_API_KEY"},
    json={"type": "text", "to": "+447700900123", "message": "Hello from SMSID"},
)
print(resp.json())
const res = await fetch("https://smsid.co.uk/api/v1/whatsapp/send", {
  method: "POST",
  headers: { "X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({ type: "text", to: "+447700900123", message: "Hello from SMSID" }),
});
console.log(await res.json());

Delivery statuses

Messages move through these statuses as WhatsApp reports back: queued → sent → delivered → read, or failed. Status updates are delivered to your account automatically.

Errors

Errors return a non-200 status with a message in the meta object. The API is rate limited to 120 requests per minute per key.

{
  "meta": { "code": 400, "text": "The WhatsApp channel is not enabled." }
}