Skip to content

    Arabic or English · ↑↓ to move · Enter to open · Esc to close

    العربية
    On this page

    Quickstart: your first message in 3 steps

    Create an API key, send a WhatsApp message from your own number and receive your first signed webhook — in about ten minutes.

    Connect an official number and use a plan with API access. Send a WhatsApp message from your test phone to the connected number first. This opens the 24-hour window for the text below.

    1. Identify your sending number

    In Settings → API keys create an account key for the connected number with numbers:read, messages:send, messages:read and webhooks:write. On your server set WASLA_API_KEY to the key shown once. Run both requests below. Copy the connected number’s data[].id into NUMBER_ID.

    curl -X GET "https://mursilat.com/api/v2/me" \
      -H "Authorization: Bearer $WASLA_API_KEY"
    curl -X GET "https://mursilat.com/api/v2/numbers" \
      -H "Authorization: Bearer $WASLA_API_KEY"

    2. Connect your receipt handler

    Set WEBHOOK_URL to your public HTTPS receiver. On first setup, store the returned secret for signature verification. Updating the subscription replaces its event list. Use a test number or include any events you already consume.

    bash
    API=https://mursilat.com/api/v2
    curl -sS -X PUT "$API/numbers/$NUMBER_ID/webhook" \
      -H "Authorization: Bearer $WASLA_API_KEY" \
      --json "$(jq -n --arg url "$WEBHOOK_URL" '{url:$url, events:["message.status"]}')"

    The shell examples use jq and curl with --json support. Implement signature verification, then send a test. Continue when your receiver gets webhook.test and returns HTTP 204.

    bash
    curl -sS -X POST "$API/numbers/$NUMBER_ID/webhook/test" -H "Authorization: Bearer $WASLA_API_KEY"

    3. Send one message and follow its receipt

    Set TO to your test phone in international digits. Generate a key once per new message. If the response is lost, reuse that key and the same body for the retry.

    bash
    SEND_KEY=$(uuidgen)
    curl -sS "$API/messages" \
      -H "Authorization: Bearer $WASLA_API_KEY" \
      -H "Idempotency-Key: $SEND_KEY" \
      --json "$(jq -n --arg n "$NUMBER_ID" --arg to "$TO" '{numberId:$n,to:$to,type:"text",text:"Hello from Mursilat"}')"
    HTTP 200
    {
      "id": "3EB0A1B2C3D4E5F60718",
      "numberId": "cm1abcd2345efgh6789ijkl",
      "status": "sent",
      "type": "text",
      "reference": null,
      "scheduledAt": null,
      "interactionId": null,
      "format": null,
      "fallbackIncluded": null,
      "estimatedDelayMs": null
    }

    Set MESSAGE_ID to id from your response. Match it to data.messageId in the signed message.status event. sent means submission, delivered confirms delivery, read is a read receipt. For failed inspect data.error.code before another send.

    message.status
    {
      "id": "evt_5f0c2b7d9e1a4c3b8a6f2d10",
      "type": "message.status",
      "apiVersion": "2026-10",
      "createdAt": "2026-10-13T08:00:03.000Z",
      "sessionId": "cm1abcd2345efgh6789ijkl",
      "number": "201001234567",
      "data": {
        "messageId": "3EB0A1B2C3D4E5F60718",
        "reference": null,
        "to": "201099887766",
        "status": "delivered",
        "error": null,
        "timestamp": "2026-10-13T08:00:05.000Z"
      }
    }
    bash
    curl -sS "$API/messages/$MESSAGE_ID" -H "Authorization: Bearer $WASLA_API_KEY"
    HTTP 200
    {
      "id": "3EB0A1B2C3D4E5F60718",
      "numberId": "cm1abcd2345efgh6789ijkl",
      "type": "text",
      "reference": null,
      "to": "2010****4567",
      "status": "read",
      "scheduledAt": null,
      "error": null,
      "interactionId": null,
      "timeline": [
        {
          "status": "queued",
          "at": "2026-10-13T08:00:00.000Z"
        },
        {
          "status": "sent",
          "at": "2026-10-13T08:00:01.200Z"
        },
        {
          "status": "delivered",
          "at": "2026-10-13T08:00:02.900Z"
        },
        {
          "status": "read",
          "at": "2026-10-13T08:03:10.000Z"
        }
      ],
      "createdAt": "2026-10-13T08:00:00.000Z",
      "updatedAt": "2026-10-13T08:03:10.000Z"
    }

    Use timeline to reconcile a missed receipt. See message.status.