Developers: API and webhooks

Use the Chatbot Builder API to add contacts and send WhatsApp messages from your own software, and webhooks to hear about new messages, delivery status, new contacts and finished campaigns. The API and webhooks are part of the Scale plan.

1. Get an API key

In the app, open Integrations → API access for developers → Create new key. The key starts with wcb_live_ and is shown only once. Keep it secret and use it only from your server. You can remove a key any time; it stops working right away.

2. Make a request

Base URL: https://wsoop.online/api/v1/public. Send the key in the Authorization header. Requests and responses are JSON. Each key can make 60 requests per minute; above that you get status 429.

Phone numbers include the country code, for example 919876543210. A 10-digit Indian number is also accepted.

Create or update a contact

curl -X POST https://wsoop.online/api/v1/public/contacts \
  -H "Authorization: Bearer wcb_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone":"919876543210","name":"Riya","tags":["Website lead"],"customFields":{"city":"Pune"}}'

Matched by phone: if the contact exists it is updated. The answer is { "created": true, "contact": { ... } }. Optional consent: OPTED_IN, OPTED_OUT or UNKNOWN.

Add tags

curl -X POST https://wsoop.online/api/v1/public/contacts/919876543210/tags \
  -H "Authorization: Bearer wcb_live_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"names":["VIP","Diwali 2026"]}'

Send a template message

Works any time, with an approved template. params fill {{1}}, {{2}} … in the template body, in order.

curl -X POST https://wsoop.online/api/v1/public/messages/template \
  -H "Authorization: Bearer wcb_live_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"phone":"919876543210","templateName":"order_update","language":"en","params":["Riya","#1042"]}'

The answer is { "id": "msg_id", "status": "queued" }. The message costs the template rate from your wallet.

Send a text message

Only within 24 hours after the customer last messaged you (WhatsApp rule). Otherwise you get 409 and should send a template.

curl -X POST https://wsoop.online/api/v1/public/messages/text \
  -H "Authorization: Bearer wcb_live_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"phone":"919876543210","text":"Your order is out for delivery."}'

Check a message status

curl https://wsoop.online/api/v1/public/messages/MESSAGE_ID -H "Authorization: Bearer wcb_live_YOUR_KEY"

status is queued, sent, delivered, read or failed (with errorMessage).

Errors

Errors look like { "statusCode": 400, "error": "BAD_REQUEST", "message": "Enter a valid phone number…" }. 401 = missing or removed key, 403 = not in your plan, 404 = not found, 409 = not allowed right now (opted out, 24-hour window closed), 402 = trial ended, 429 = too many requests.

3. Webhooks

In Integrations → Webhooks, enter your HTTPS URL and choose events. We send a POST with a JSON body:

{
  "event": "message.received",
  "createdAt": "2026-11-12T10:15:00.000Z",
  "data": { "messageId": "…", "contact": { "phone": "919876543210", "name": "Riya" }, "type": "text", "text": "Hi" }
}
  • message.received — Message received
  • message.status — Message delivered or read
  • contact.created — New contact created
  • campaign.finished — Campaign finished

Headers: X-Webhook-Id (same on retries, use it to skip duplicates), X-Webhook-Event, and X-Webhook-Signature = sha256= + HMAC-SHA256 of the raw body with your webhook secret.

Answer with any 2xx within 5 seconds. If not, we retry up to 6 times over about 3 hours. After 20 failed calls in a row we turn the webhook off and email your Admins. You can see the last 100 deliveries and send a test event from the Integrations screen.

Verify the signature in Node.js

// Express: keep the raw body so the signature matches byte for byte.
import crypto from 'node:crypto';
import express from 'express';

const app = express();
const SECRET = process.env.WEBHOOK_SECRET; // whsec_... shown once when you created the webhook

app.post('/whatsapp-events', express.raw({ type: 'application/json' }), (req, res) => {
  const expected = 'sha256=' + crypto.createHmac('sha256', SECRET).update(req.body).digest('hex');
  const given = req.get('X-Webhook-Signature') || '';
  const ok = given.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected));
  if (!ok) return res.status(401).send('bad signature');

  const event = JSON.parse(req.body.toString('utf8'));
  // Use X-Webhook-Id to ignore a delivery you already handled (retries reuse the id).
  console.log(event.event, event.data);
  res.sendStatus(200); // answer within 5 seconds
});

app.listen(3000);

Verify the signature in PHP

<?php
$secret   = getenv('WEBHOOK_SECRET'); // whsec_...
$payload  = file_get_contents('php://input');
$expected = 'sha256=' . hash_hmac('sha256', $payload, $secret);
$given    = $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? '';

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

$event = json_decode($payload, true);
// $event['event'], $event['data'], header X-Webhook-Id for de-duplication
http_response_code(200);

Questions? Contact us.