Skip to main content

Overview

This document explains how clients can use Eazybe’s Public Broadcast API for Meta WABA-related broadcast operations. The API supports:
  • API key generation
  • Single-recipient template broadcasts
  • Bulk template broadcasts
  • Health checks
  • Operational error handling
The API uses JSON requests over HTTPS and authenticates through the x-api-key header. It is intended for approved WhatsApp template-based outbound messaging through the Eazybe platform.

Base Configuration

SettingValue
Base URLhttps://cerberus.eazybe.com/prod/api/v2
Authenticationx-api-key header
Content-Typeapplication/json
Supported OperationsGenerate key, send single broadcast, send bulk broadcast, health check

Before You Start

Ensure the sending phone number is already onboarded on Eazybe and linked to an active WABA setup. API key generation will fail if no WABA account is found for the submitted number.
Confirm that your required WhatsApp templates are approved in Meta before attempting sends. Unapproved or missing templates will return request failures.

Authentication Flow

1

Generate API Key

Use this endpoint once for a registered sender number and securely store the returned API key for future requests.

Endpoint

POST /broadcast/public/generate-key

Request Body

FieldTypeRequiredDescription
phoneNumberstringYesSender phone number with country code, without spaces or +

Example Request

curl -X POST https://cerberus.eazybe.com/prod/api/v2/broadcast/public/generate-key \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumber": "919876543210"
  }'

Success Response

{
  "status": true,
  "status_code": 200,
  "message": "API key generated successfully",
  "data": {
    "apiKey": "15558044483"
  }
}

Failure Example

{
  "status": false,
  "status_code": 400,
  "message": "User is not signed up yet.",
  "data": {
    "error": {
      "message": "No WABA account found for this phone number"
    }
  }
}
2

Use API Key in Request Headers

All broadcast endpoints require the generated API key in the x-api-key header.

x-api-key: YOUR_API_KEY
Store your API key securely. Avoid regenerating it unnecessarily.

Send Single Broadcast

Use the single broadcast endpoint to send one template message to one recipient.

Endpoint

POST /broadcast/public/send-single

Required Request Structure

FieldTypeRequiredDescription
templateNamestringYesApproved WhatsApp template name
templateLanguagestringYesTemplate language code (e.g., en)
templateTypestringYesTemplate category: MARKETING, UTILITY, or AUTHENTICATION
countryCodestringYesRecipient country code without +
toPhoneNumberstringYesRecipient mobile number
templateIdstringNoMeta template ID
templateParamsstring[]NoTemplate variable values in order
broadcastNamestringNoOptional label for this send

Example Request

curl -X POST https://cerberus.eazybe.com/prod/api/v2/broadcast/public/send-single \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "templateName": "christmas_template",
    "templateLanguage": "en",
    "templateType": "MARKETING",
    "templateId": "768465685803110",
    "countryCode": "91",
    "toPhoneNumber": "8077378155",
    "templateParams": ["John", "100"],
    "broadcastName": "Single Broadcast Test"
  }'

Success Response

{
  "status": true,
  "message": "Single broadcast queued successfully",
  "data": {
    "broadcastId": "6789abcdef123456",
    "campaign_id": "abc123xyz456",
    "status": "PENDING_SEND"
  }
}

Common Failure Responses


Send Bulk Broadcast

Use the bulk endpoint to send the same approved template to multiple recipients in one request. A single request can include up to 1000 recipients.

Endpoint

POST /broadcast/public/send-bulk

Required Request Structure

FieldTypeRequiredDescription
broadcastNamestringYesUnique campaign name
templateNamestringYesApproved WhatsApp template name
templateLanguagestringYesTemplate language code
templateTypestringYesTemplate category
dataarrayYesRecipient list, maximum 1000 per request
templateIdstringNoMeta template ID
globalTemplateParamsstring[]NoDefault variables used when recipient-level params are not provided

Recipient Object in data

FieldTypeRequiredDescription
countryCodestringYesRecipient country code without +
toPhoneNumberstringYesRecipient mobile number
templateParamsstring[]NoRecipient-level variables that override global values

Example Request

curl -X POST https://cerberus.eazybe.com/prod/api/v2/broadcast/public/send-bulk \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "broadcastName": "Festival Campaign 2024",
    "templateName": "festive_offer_promo",
    "templateLanguage": "en",
    "templateType": "MARKETING",
    "templateId": "1172528374418691",
    "data": [
      {
        "countryCode": "91",
        "toPhoneNumber": "9897964421",
        "templateParams": ["John Doe", "212812790", "16-02-2026"]
      },
      {
        "countryCode": "91",
        "toPhoneNumber": "8077378155",
        "templateParams": ["Vineet", "122878278", "14-02-2026"]
      }
    ],
    "globalTemplateParams": ["Default Company", "Test date"]
  }'

Success Response

{
  "status": true,
  "message": "Broadcast is being processed",
  "data": {
    "total_contacts": 2,
    "failed_contacts": 0,
    "estimated_cost": 0.15,
    "oldBalance": 100.5,
    "newEstimatedBalance": 100.35
  }
}

Operational Notes

  • A bulk request cannot exceed 1000 recipients.
  • Broadcast names must be unique, otherwise the request fails.
Invalid numbers can create partial failures. Failed contacts are counted separately and credits are not deducted for those invalid contacts. Failed contacts may be stored with failure_reason_code: “INVALID_PHONE_NUMBER” for downstream tracking.

Template Parameter Handling

The API supports both recipient-level parameters and global parameters.

Recipient-Level Parameters

Use templateParams inside each recipient object when every contact should receive different variable values. Example use cases:
  • Order ID per customer
  • Appointment time per customer
  • Personalized name per recipient

Global Parameters

Use globalTemplateParams when the same variable values apply to all recipients in a bulk campaign. This reduces repeated payload data and is useful for common campaign-wide values such as brand name, coupon code, or offer percentage.

Rule of Precedence

When recipient-level templateParams are provided, they override the global values for that recipient.

Health Check

Use the health endpoint to verify whether the Public Broadcast API service is operational.

Endpoint

GET /broadcast/public/health

Example Request

curl -X GET https://cerberus.eazybe.com/prod/api/v2/broadcast/public/health

Sample Response

{
  "status": "ok",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "service": "Public Broadcast API",
  "version": "1.0.0",
  "endpoints": {
    "single": "POST /broadcast/public/send-single",
    "bulk-standard": "POST /broadcast/public/send-bulk-standard",
    "health": "GET /broadcast/public/health"
  }
}

Error Handling Reference

Status CodeErrorMeaning
400User is not signed up yetAPI key is invalid or the phone number is not registered
400No subscriptions availableNo active subscription is available for broadcasts
400Insufficient creditsWallet balance is not enough
400Template does not existTemplate is missing or not approved
400Invalid template languageRequested template language variant is not approved
400Invalid phone number formatCountry code or phone format is invalid
400Pricing not availableSending is not supported for the target country code
400Recipient limit exceededBulk request contains more than 1000 recipients
400Broadcast with same name existsCampaign name must be unique
500Internal Server ErrorUnexpected server-side error

Failure Reason Codes

CodeMeaningNotes
INVALID_PHONE_NUMBERInvalid recipient numberCheck country code and number formatting
UNSUPPORTED_COUNTRY_CODECountry pricing unavailableDestination not supported
TEMPLATE_SEND_FAILEDTemplate send failedReview raw API error response
131014Invalid parameterTemplate parameter issue
131051Rate limit exceededToo many requests sent in a short interval
WORKER_ERRORWorker processing failureReview worker error response

Rate Limits and Platform Constraints

Meta has an approximate sending rate of around 30 messages per second per WABA. The API includes automatic retry with exponential backoff for rate-limit errors such as 429, 80007, and 130429.
Batch responsibly and split large uploads into multiple requests once you approach the 1000-recipient per-request limit.

1

Onboard and Verify

Onboard and verify the sender number on Eazybe before any API use.

2

Generate API Key

Generate the API key once and store it securely.

3

Verify Templates

Ensure the WhatsApp template is approved in Meta and the language variant is available.

4

Validate Data

Validate recipient country codes, phone numbers, and template variable count before sending.

5

Send Broadcast

Use the single endpoint for one-off tests and the bulk endpoint for campaigns.

6

Monitor Response

Monitor the response for failed_contacts, balance changes, and queue status.

7

Use Unique Names

Use unique broadcast names for every campaign.


Best Practices

  • Store the API key securely and avoid regenerating it unnecessarily
  • Pre-validate numbers to reduce failures and operational cleanup
  • Match the number of template variables exactly with the approved template placeholders
  • Use globalTemplateParams for shared values and recipient-level params only when personalization is required
  • Check credits before large broadcast requests
  • Start with a small test batch before sending full-volume campaigns

Example Payload Patterns

Single Send with Variables

{
  "templateName": "order_shipped",
  "templateLanguage": "en",
  "templateType": "MARKETING",
  "countryCode": "91",
  "toPhoneNumber": "9876543210",
  "templateParams": ["John", "ORD12345", "17-02-2024"]
}

Bulk Send with Recipient-Level Variables

{
  "broadcastName": "Appointment Reminders",
  "templateName": "appointment_reminder",
  "templateLanguage": "en",
  "templateType": "UTILITY",
  "data": [
    {
      "countryCode": "1",
      "toPhoneNumber": "5551234567",
      "templateParams": ["Alice", "2024-01-20", "10:00 AM"]
    },
    {
      "countryCode": "1",
      "toPhoneNumber": "5559876543",
      "templateParams": ["Bob", "2024-01-20", "2:30 PM"]
    }
  ]
}

Bulk Send with Global Variables

{
  "broadcastName": "Global Promo",
  "templateName": "promo_offer",
  "templateLanguage": "en",
  "templateType": "MARKETING",
  "data": [
    {
      "countryCode": "91",
      "toPhoneNumber": "9876543210"
    },
    {
      "countryCode": "91",
      "toPhoneNumber": "9876543211"
    }
  ],
  "globalTemplateParams": ["MyStore", "SAVE20", "20"]
}