# Neupa Hosting API > REST APIs for WhatsApp messaging and tenant-scoped M-Pesa payment collection. ## Authentication WhatsApp endpoints use an `api_key` query parameter. M-Pesa Gateway endpoints use a Sanctum bearer token and require API access to be enabled on the account. ## WhatsApp Base URL https://neupa.co.ke/api/v1/whatsapp ## Endpoints - GET /status — Check WhatsApp instance connection state - POST /start — Start or reconnect the WhatsApp session - GET /qr — Get QR code (base64 PNG) for scanning - POST /sync — Force a profile/session sync - POST /send — Send a text or media message to one recipient - GET /messages — Retrieve sent/received message logs - POST /broadcast — Send one message to up to 500 recipients at once - GET /broadcast — List all broadcast batches and stats - GET /broadcast/{id} — Get result of a specific broadcast batch - GET /webhooks — List registered webhooks - POST /webhooks — Register a new webhook URL - DELETE /webhooks/{id} — Delete a webhook ## M-Pesa Gateway Base URL: https://neupa.co.ke/api/v1/mpesa Documentation: https://neupa.co.ke/mpesa-api All M-Pesa Gateway requests require `Authorization: Bearer YOUR_TOKEN`. - POST /config — Save this merchant's Daraja credentials and Till/PayBill destination - GET /config — Read destination status without returning secrets - POST /stk-push — Prompt the payer's phone for payment - POST /check-status — Check a transaction owned by this merchant - POST /c2b/register — Register C2B callback URLs for this merchant's PayBill Supply the merchant's authorized Consumer Key, Consumer Secret, Passkey, and shortcode. Secrets are encrypted at rest and omitted from API responses. ## Key request body fields — POST /send - to string required Recipient phone in international format (e.g. 254712345678, no +) - message string required Message text body - type string optional "text" (default) or "media" - media_url string optional Required when type=media - caption string optional Caption for media messages ## Key request body fields — POST /broadcast - message string required Message body; use {name} for personalisation - recipients array required [{phone: "254...", name: "Alice"}, ...] - label string optional Label for your records - type string optional "text" (default) or "media" ## Authentication example ``` curl 'https://neupa.co.ke/api/v1/whatsapp/status?api_key=YOUR_TOKEN' ``` ## Send message example ``` curl 'https://neupa.co.ke/api/v1/whatsapp/send?api_key=YOUR_TOKEN' \ -X POST -H 'Content-Type: application/json' \ -d '{\"to\":\"254712345678\",\"message\":\"Hello!\",\"type\":\"text\"}' ``` ## Error codes - 401 Unauthorized — invalid or missing api_key - 400 Bad Request — missing required parameters - 404 Not Found — instance or resource not found - 429 Too Many Requests — rate limit exceeded - 503 Service Unavailable — WhatsApp engine unreachable - 500 Server Error — unexpected internal error ## Machine-readable spec Full OpenAPI 3.0 spec: https://neupa.co.ke/openapi.json Interactive docs: https://neupa.co.ke/docs ## Integration guides - WordPress plugin: download neupa-whatsapp.zip, install, paste Access Token at Settings → Neupa WhatsApp - Laravel: set WAWP_INSTANCE_ID and WAWP_ACCESS_TOKEN in .env, see https://neupa.co.ke/docs#section-laravel