WhatsApp API Overview


Welcome to the Cloud Rebue WhatsApp Business API! Our RESTful API allows you to send high-volume, dynamic WhatsApp messages globally.

Whether you are sending automated order confirmations, marketing media, or OTP authentication codes, our infrastructure is designed for speed, reliability, and ease of use.

Core Concepts

Before diving into the specific endpoint documentation, here are a few key concepts that power our WhatsApp API:

1. Array-First Architecture (Batching)

Our API expects the JSON body to be an Array of Objects, even if you are only sending a single message. This allows you to queue up to 100 messages in a single HTTP request, vastly improving your system's throughput and reducing network latency.

You can even mix and match different templates (e.g., sending a text message and a video message) in the exact same batch.

2. Meta-Approved Templates

WhatsApp requires all business-initiated messages to use pre-approved templates. You must create and approve your templates inside your WhatsApp Business Manager (or via our Dashboard) before you can trigger them via the API. Templates are categorized into:

  • Utility: Order updates, account alerts.
  • Authentication: OTPs and login codes.
  • Marketing: Promotions, newsletters, and offers.

3. Dynamic Variables

If your template contains placeholders like 1 or 2, you will pass these dynamically via the API using arrays.

  • body_variables: Maps to variables in the text body.
  • header: Maps to a text variable or media file (Image, Document, Video) in the header.
  • button_variables: Maps to dynamic URLs or copy-code buttons.

4. Asynchronous Delivery & Webhooks

When you submit a request, our API instantly validates the payload, reserves the estimated funds from your wallet, and queues the message. It will return a 200 OK response with a message_id.

Because Meta delivers messages asynchronously, you can provide a delivery_endpoint (Webhook URL) in your API request. We will seamlessly forward formatted, real-time Meta delivery receipts (sent, delivered, read, failed) directly to your server for that specific message.

5. Correlators

To help you match our webhook delivery receipts to your own internal database records, you can pass a custom correlator string (like an Order ID or User ID) in your API request. We will echo this exact string back to you in every webhook event for that message.

6. Developer Webhooks (Raw Meta Firehose)

While the delivery_endpoint parameter provides simplified, formatted receipts per message, advanced developers can configure a global Developer Webhook on their WhatsApp Business Account (WABA) via the dashboard.

This acts as a "Firehose", forwarding the exact, raw JSON payloads directly from Meta to your server. It is ideal for:

  • Two-Way Messaging: Receiving inbound messages (user replies) in real-time.
  • SDK Compatibility: Parsing payloads natively using official Meta WhatsApp Cloud API SDKs.
  • Granular Data: Capturing deep Meta error codes, timestamps, and pricing models directly from the source.

Prerequisites

Before making your first API call, ensure you have:

  1. An Active API Token: Generated from your Developer Settings dashboard.
  2. A Connected WABA: A WhatsApp Business Account connected to our platform.
  3. Approved Templates: At least one Meta-approved template in your account.
  4. Sufficient Balance: Your wallet must have enough funds (KES or USD) to cover the estimated Meta conversation costs.

Supported Message Types

Choose a message type below to see exact payload examples, required parameters, and JSON structures:

{info} Remember to include your Authorization: Bearer <your-token> header in all requests.