Docs & API

Build on the Taswiq API

REST endpoints, real-time webhooks and copy-paste examples in cURL, JavaScript and Python to get you sending messages in minutes.

1. Get your API key

Generate a key from Settings → API & Webhooks in your dashboard.

2. Authenticate requests

Pass it as a Bearer token in the Authorization header.

3. Call the API

Base URL: https://api.taswiq.qa/v1

POST

Send a WhatsApp Message

Send a free-form or template message to any WhatsApp number connected to your business.

# Send a WhatsApp message via Taswiq API
curl -X POST https://api.taswiq.qa/v1/messages \
  -H "Authorization: Bearer TASWIQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "whatsapp",
    "to": "+97450001234",
    "type": "text",
    "text": { "body": "Hi! Your order has shipped 🚚" }
  }'
POST

Create a Broadcast Campaign

Trigger a Meta-approved template broadcast to a saved audience segment.

curl -X POST https://api.taswiq.qa/v1/broadcasts \
  -H "Authorization: Bearer TASWIQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "ramadan_offer",
    "audience_id": "seg_vip_customers",
    "schedule_at": "2026-09-01T09:00:00+03:00"
  }'
Real-time events

Webhook Setup Guide

  1. 1

    Add an endpoint URL

    In Settings → API & Webhooks, register a public HTTPS URL to receive events.

  2. 2

    Choose your events

    Subscribe to message.received, message.delivered, conversation.assigned & more.

  3. 3

    Verify the signature

    Every payload is signed with HMAC-SHA256 using your webhook secret.

  4. 4

    Return a 200 OK

    Acknowledge within 5 seconds — Taswiq retries with backoff on failure.

webhook-payload.json
{
  "event": "message.received",
  "timestamp": "2026-08-23T09:14:02Z",
  "channel": "whatsapp",
  "conversation_id": "cnv_88213",
  "from": "+97450001234",
  "message": {
    "type": "text",
    "body": "Is this in stock?"
  },
  "signature": "sha256=4f2a9c..."
}

Need a tunnel for local testing? Use ngrok or the built-in Taswiq webhook simulator in your dashboard.

Get your API key and start building

Free trial accounts include full API & webhook access.