Skip to main content

Mobitech Developers

WhatsApp Business API

Getting started

A simple REST API over the official WhatsApp Business Platform (Cloud API). If you already use Mobitech Bulk SMS, the flow is the same: authenticate with an API key, POST messages and receive delivery reports on your webhook.

Base URLhttps://wa.mobitechtechnologies.com/api/v1
FormatJSON (UTF-8)
AuthBearer API key
  1. Create a WhatsApp workspace, connect your WhatsApp number and wait for Mobitech to approve the account.
  2. In the portal, open Developers and create an API key (and, optionally, your webhook URL).
  3. Send a message. Numbers can be written as 0712345678, +254712345678 or 254712345678.

WhatsApp rules you need to know

  • You can only start a conversation with an approved template.
  • Free-form messages (text, media, buttons) are allowed within 24 hours of the customer's last message.
  • Contacts who reply STOP are opted out automatically and won't receive templates.

Authentication

Create an API key under Developers in the portal and send it as a Bearer token. Keys start with mbt_live_. Check your key with GET /account, which returns your organization, wallet balance, per-category rates and connected numbers.

GET https://wa.mobitechtechnologies.com/api/v1/account
Request
curl "https://wa.mobitechtechnologies.com/api/v1/account" \
  -H "Authorization: Bearer mbt_live_xxxxxxxxxxxxxxxxxxxx"
GET https://wa.mobitechtechnologies.com/api/v1/phone-numbers

Lists your connected WhatsApp numbers. Pass a number's id as phone_number_id to send from it.

Send a text message

POST https://wa.mobitechtechnologies.com/api/v1/messages

Queues a message and returns 202 Accepted with the message id. The delivery status arrives on your webhook or from GET /messages/:id.

Body

to string required
Recipient phone number in any common format.
type string required
text, template, image, document, video, audio, sticker, location, reaction or interactive.
text string optional
The message, for type: text.
phone_number_id string optional
Send from this number; defaults to your default number.
client_reference string optional
Your own id, returned in responses and webhooks.
Request
curl -X POST "https://wa.mobitechtechnologies.com/api/v1/messages" \
  -H "Authorization: Bearer mbt_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "0712345678",
  "type": "text",
  "text": "Hello Jane, your order has shipped 🚚",
  "client_reference": "order-1024"
}'
Response 202
{
  "data": {
    "id": 5812,
    "status": "queued",
    "to": "254712345678",
    "type": "text",
    "category": "service",
    "cost": "0.0000",
    "client_reference": "order-1024",
    "created_at": "2026-09-29T10:15:02Z"
  }
}

Send a template

Templates start conversations and are charged by category (marketing, utility, authentication). Variables are passed in order.

Request
curl -X POST "https://wa.mobitechtechnologies.com/api/v1/messages" \
  -H "Authorization: Bearer mbt_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "254712345678",
  "type": "template",
  "template": {
    "name": "order_update",
    "language": "en",
    "params": {
      "body": ["Jane", "#1024"],
      "header": ["October"],
      "header_media": "https://cdn.example.co.ke/banner.jpg",
      "buttons": {
        "0": ["track/1024"]
      }
    }
  }
}'

Shortcut: "params": ["Jane", "#1024"] is treated as the body parameters. Advanced users can pass raw Meta components instead of params.

Media & interactive messages

Allowed inside the 24-hour customer service window. Media must be a public https link.

Image or document

Request
curl -X POST "https://wa.mobitechtechnologies.com/api/v1/messages" \
  -H "Authorization: Bearer mbt_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "0712345678",
  "type": "document",
  "document": {
    "link": "https://example.co.ke/invoice.pdf",
    "filename": "Invoice-1024.pdf"
  }
}'

For an image use "type": "image", "image": { "link": "…", "caption": "Your receipt" }.

Reply buttons (up to 3)

Request
curl -X POST "https://wa.mobitechtechnologies.com/api/v1/messages" \
  -H "Authorization: Bearer mbt_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "0712345678",
  "type": "interactive",
  "buttons": {
    "body": "Would you like to confirm your appointment?",
    "buttons": [
      {
        "id": "yes",
        "title": "Confirm"
      },
      {
        "id": "no",
        "title": "Reschedule"
      }
    ]
  }
}'

List menu (up to 10 rows)

Body
{
  "to": "0712345678",
  "type": "interactive",
  "list": {
    "body": "Choose a service",
    "button": "Services",
    "sections": [
      {
        "title": "Popular",
        "rows": [
          {
            "id": "sms",
            "title": "Bulk SMS",
            "description": "From KES 0.35"
          },
          {
            "id": "wa",
            "title": "WhatsApp API"
          }
        ]
      }
    ]
  }
}

Also supported: video, audio, sticker, location and reaction.

OTP / authentication codes

Create an Authentication template in the portal (Meta writes the wording and adds a copy-code button), then send the code:

Request
curl -X POST "https://wa.mobitechtechnologies.com/api/v1/messages" \
  -H "Authorization: Bearer mbt_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "0712345678",
  "type": "template",
  "template": {
    "name": "login_otp",
    "language": "en",
    "otp": "482913"
  }
}'

Message status

GET https://wa.mobitechtechnologies.com/api/v1/messages/:id
GET https://wa.mobitechtechnologies.com/api/v1/messages
Request
curl "https://wa.mobitechtechnologies.com/api/v1/messages?status=failed&since=2026-09-01T00%3A00%3A00Z&limit=100" \
  -H "Authorization: Bearer mbt_live_xxxxxxxxxxxxxxxxxxxx"

Query filters

status optional
queued, sent, delivered, read, failed or received.
direction optional
inbound or outbound.
phone optional
Only messages to or from this number.
client_reference optional
Your own id.
since optional
ISO-8601 time, e.g. 2026-09-01T00:00:00Z.
before_id optional
Pagination cursor: pass the last id you received.
limit optional
Up to 500.

Lifecycle: queued β†’ sent β†’ delivered β†’ read, or failed with an error object. Failed messages are refunded automatically.

Bulk broadcasts

POST https://wa.mobitechtechnologies.com/api/v1/broadcasts

Sends one template to up to 10,000 recipients per request, each with their own parameters. Add scheduled_at (ISO-8601, UTC) to send later.

Request
curl -X POST "https://wa.mobitechtechnologies.com/api/v1/broadcasts" \
  -H "Authorization: Bearer mbt_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "October promo",
  "template": {
    "name": "october_offer",
    "language": "en",
    "params": {
      "body": ["Customer"]
    }
  },
  "recipients": [
    {
      "to": "0712345678",
      "name": "Jane",
      "params": {
        "body": ["Jane"]
      }
    },
    {
      "to": "0722000111"
    },
    "0733000222"
  ],
  "scheduled_at": "2026-10-01T06:00:00Z"
}'
GET https://wa.mobitechtechnologies.com/api/v1/broadcasts/:id
POST https://wa.mobitechtechnologies.com/api/v1/broadcasts/:id/cancel

The full cost is reserved at launch and failures are refunded when the broadcast completes.

Contacts

GET https://wa.mobitechtechnologies.com/api/v1/contacts?q=jane&tag=vip&group_id=3&page=1
POST https://wa.mobitechtechnologies.com/api/v1/contacts
PATCH https://wa.mobitechtechnologies.com/api/v1/contacts/:id
DELETE https://wa.mobitechtechnologies.com/api/v1/contacts/:id
GET https://wa.mobitechtechnologies.com/api/v1/contact-groups
Create a contact
curl -X POST "https://wa.mobitechtechnologies.com/api/v1/contacts" \
  -H "Authorization: Bearer mbt_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "0712345678",
  "name": "Jane Wanjiku",
  "email": "jane@example.com",
  "tags": ["vip"],
  "attributes": {
    "city": "Nairobi"
  },
  "group_ids": [3]
}'

Templates

GET https://wa.mobitechtechnologies.com/api/v1/templates?status=APPROVED

Each template includes an inputs object describing the variables it needs.

POST https://wa.mobitechtechnologies.com/api/v1/templates
Create (submitted to Meta for review)
curl -X POST "https://wa.mobitechtechnologies.com/api/v1/templates" \
  -H "Authorization: Bearer mbt_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "order_update",
  "language": "en",
  "category": "UTILITY",
  "header_type": "TEXT",
  "header_text": "Order update",
  "body": "Hi {{1}}, your order {{2}} is on the way.",
  "body_examples": ["Jane", "#1024"],
  "footer": "Mobitech Shop",
  "buttons": [
    {
      "type": "URL",
      "text": "Track",
      "url": "https://shop.co.ke/t/{{1}}",
      "url_example": "https://shop.co.ke/t/1024"
    }
  ]
}'
POST https://wa.mobitechtechnologies.com/api/v1/templates/sync

Fetches the latest template statuses from Meta.

Webhooks

Set your endpoint under Developers in the portal. We POST JSON and retry with exponential backoff (8 attempts over about a day) until your server answers with a 2xx status.

message.received
{
  "event": "message.received",
  "organization_id": 12,
  "timestamp": "2026-09-29T10:16:40Z",
  "data": {
    "id": 5813,
    "wamid": "wamid.HBgM...",
    "direction": "inbound",
    "type": "text",
    "from": "254712345678",
    "body": "Hi, is this in stock?",
    "reply": {
      "id": null,
      "text": "Hi, is this in stock?"
    },
    "conversation_id": 311,
    "created_at": "2026-09-29T10:16:39Z"
  }
}
message.status
{
  "event": "message.status",
  "data": {
    "id": 5812,
    "status": "delivered",
    "client_reference": "order-1024",
    "delivered_at": "2026-09-29T10:15:05Z",
    "error": null
  }
}

Verify the signature

Every webhook carries X-Mobitech-Signature: sha256=<hex>, an HMAC-SHA256 of the raw request body using your signing secret. Reject requests where it doesn't match.

Verify
<?php
$body = file_get_contents('php://input');
$expected = 'sha256=' . hash_hmac('sha256', $body, getenv('MOBITECH_WEBHOOK_SECRET'));
$given = $_SERVER['HTTP_X_MOBITECH_SIGNATURE'] ?? '';

if (!hash_equals($expected, $given)) {
    http_response_code(401);
    exit;
}

$event = json_decode($body, true);
error_log($event['event']);
http_response_code(200);

Errors & limits

Error shape
{
  "error": {
    "code": "window_closed",
    "message": "The 24-hour customer service window is closed..."
  }
}
HTTPcodeMeaning
401unauthorizedMissing or invalid API key
402insufficient_balanceTop up your wallet
403organization_pendingAccount awaiting Mobitech approval
422window_closedUse a template: the 24-hour window has closed
422invalid_recipientPhone number could not be parsed
422recipient_opted_outContact replied STOP
422validation_failedSee details for field errors
429rate_limitedMore than 50 requests per second per key
502meta_errorWhatsApp rejected the request

Need help? Email info@mobitechtechnologies.com or chat with us on WhatsApp.

Frequently Asked Questions

How do I send a WhatsApp message through an API in Kenya?

Create an API key in the Mobitech WhatsApp portal, then POST to https://wa.mobitechtechnologies.com/api/v1/messages with Authorization: Bearer YOUR_KEY. Start conversations with an approved template; free-form text is allowed within 24 hours of the customer's last message.

Can I send WhatsApp OTP codes?

Yes. Create an Authentication template in the portal and send it with type template and the code in the otp field. WhatsApp adds a copy-code button.

How do I receive WhatsApp replies in my system?

Set a webhook URL under Developers in the portal. Mobitech POSTs message.received and message.status events signed with an X-Mobitech-Signature HMAC-SHA256 header.

Talk to us