WhatsApp Business API

Send WhatsApp Messages From Your Own App

A separate, dedicated API from our SMS endpoints — WhatsApp works differently under the hood: pre-approved templates instead of free text, and explicit recipient consent required on every send. This page covers exactly what you need.

Get Your API Key ← Back to SMS API Docs
Consent is required, every time

Every request must include consent: "yes" — meaning you've genuinely confirmed the recipient agreed to be contacted on WhatsApp. Sending without real consent risks WhatsApp restricting or banning the shared account for every customer, not just yours. This is enforced server-side; there is no way to bypass it.

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://yoolasms.com/api/v1/send-whatsapp',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
    "api_key": "YOUR_API_KEY_HERE",
    "phone": "256704487563",
    "template_name": "yoola_otp_verification",
    "template_params": ["482913"],
    "consent": "yes"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
# Yoola SMS API - Send WhatsApp Message (cURL)
curl --location 'https://yoolasms.com/api/v1/send-whatsapp' \
--header 'Content-Type: application/json' \
--data '{
  "api_key": "YOUR_API_KEY_HERE",
  "phone": "256704487563",
  "template_name": "yoola_otp_verification",
  "template_params": ["482913"],
  "consent": "yes"
}'
# Yoola SMS API - Send WhatsApp Message (Python)
import requests

url = "https://yoolasms.com/api/v1/send-whatsapp"
payload = {
    "api_key": "YOUR_API_KEY_HERE",
    "phone": "256704487563",
    "template_name": "yoola_otp_verification",
    "template_params": ["482913"],
    "consent": "yes"
}
response = requests.post(url, json=payload)
print(response.text)

WhatsApp Endpoint

Base URL: https://yoolasms.com/api/v1/

POSTsend-whatsapp
Send a WhatsApp message using one of the approved templates below. Parameters: api_key, phone, template_name, template_params (array), consent (must be the literal string "yes"). Returns 202 with "status":"queued" automatically for sends to more than 20 recipients — no separate call needed, it's handled for you.

Available Templates

WhatsApp requires every business-initiated message to use a pre-approved template — you can't send arbitrary free text the way you can with SMS. Use the exact template_name values below; anything else is rejected before it ever reaches WhatsApp.

yoola_test_message Utility
"Hello! Your Yoola SMS account setup is complete and your WhatsApp integration is now active."
Variables needed: none — template_params can be an empty array []. Can be sent to multiple recipients at once, since there's nothing to personalize.
yoola_otp_verification Authentication
"{1} is your verification code. For your security, do not share this code."
Variables needed: 1 — the verification code, e.g. ["482913"]. Single recipient only — sending an OTP to multiple numbers in one call would give everyone the same code, so this is rejected server-side.
yoola_promo_template Marketing
"Hi {1}! We have something new for you. Check it out and don't miss this offer — available for a limited time only."
Variables needed: 1 — the recipient's name, e.g. ["James"]. Single recipient only, same reasoning as above. For sending this to many recipients with each getting their own name, use the personalized-send option below instead.

Need a template that isn't listed here?

New templates must be submitted to and approved by Meta before they can be used — this isn't something we can create instantly on request, and there's no way for a developer to submit their own template directly. Real approval typically takes anywhere from a few minutes to 24 hours once submitted. Tell us what you need and we'll get it built and approved.

Request a New Template

Sending to Many Recipients, Each With Their Own Details

For templates with variables (like the OTP or promo templates above), a single API call is restricted to one recipient — otherwise everyone would receive identical values. To message many recipients where each gets their own name, code, or amount, use the dashboard's Personalized WhatsApp Campaign feature (CSV upload, one row per recipient) rather than this direct API for now.