Mzalengo Multi-Tenant Election Platform v1.0 is live.View Live Tallies

Webhook integration

SMS, WhatsApp, and billing webhook specifications.

SMS — POST /api/webhooks/sms

Africa's Talking form fields from, text, id (JSON also accepted). If SMS_WEBHOOK_SECRET is configured, send it as the x-webhook-secret header.

WhatsApp — POST /api/webhooks/whatsapp

JSON body with from, text, optional imageUrl and id. When LOCI_HMAC_SECRET is configured, x-signature must be the HMAC-SHA256 hex of the raw body; it is verified before parsing.

Message format

[STATION <code>] [CONTEST <code>] <CANDIDATE_CODE>=<votes> … [TOTAL=<n>] [REJECTED=<n>] [PHOTO <url>]

The sender is identified by phone number; intake mode comes from their active station assignment, never from the message. Assigned agents may omit STATION/CONTEST. Provider message IDs make delivery idempotent. Unknown senders are acknowledged (200) without ingesting.

Billing — POST /api/billing/webhook

Paystack events. x-paystack-signature (HMAC-SHA512 over the raw body) is verified first;charge.success is re-verified with Paystack and activation is idempotent per reference.

Mzalengo