Base URL: https://api.nexwapi.com. Authenticate every request with header x-api-key: nex_… from Developer Settings.
Authentication
curl https://api.nexwapi.com/api/v1/account \
-H "x-api-key: nex_YOUR_SECRET_KEY"POST /api/v1/messages
Send a WhatsApp text or approved template message.
Text (24h session window)
curl -X POST https://api.nexwapi.com/api/v1/messages \
-H "x-api-key: nex_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "to": "919876543210", "text": "Hello from Nexwapi!" }'Template
curl -X POST https://api.nexwapi.com/api/v1/messages \
-H "x-api-key: nex_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "919876543210",
"template": "otp_login",
"params": ["123456"],
"language": "en"
}'Success: { "ok": true, "messageId": "wamid...." }
GET /api/v1/account
Returns workspace name, plan, and whether opted-out rejection / webhook are configured.
GET /api/v1/contacts
Query params: phone, q (search), limit (max 100).
POST /api/v1/contacts
{
"phone": "919876543210",
"name": "Riya Sharma",
"email": "[email protected]",
"optedIn": true,
"tags": ["vip"],
"attributes": { "city": "Mumbai" }
}PATCH /api/v1/contacts/:phone/opt-in
{ "optedIn": false }When Developer Settings toggle Return an error if Message Send API is called for an opted-out user is ON, send API returns 403 with OPTED_OUT.
GET /api/v1/templates
Lists approved templates available for template sends.
POST /api/v1/events
Track a custom or default event for an existing contact (Events Settings). Register custom event names under Settings → Events Settings first. The contact must already exist in your account.
curl -X POST https://api.nexwapi.com/api/v1/events \
-H "x-api-key: nex_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "Order Placed",
"phone": "919876543210",
"traits": { "order_id": "ORD-1001", "amount": "1499" }
}'Success: { "ok": true, "event": "Order Placed", "contactId": "…", "phone": "9198…" }
Also fires webhook event custom.event if a webhook URL is configured.
Outgoing webhooks
Configure a URL in Developer Settings. Nexwapi POSTs JSON events such as message.received, message.sent, message.status, chat.status, and webhook.test.
{
"event": "message.received",
"companyId": "…",
"at": "2026-08-21T05:30:00.000Z",
"data": { "from": "9198…", "text": "Hi", "type": "text" }
}Error codes
MISSING_API_KEY/INVALID_API_KEY— 401FEATURE_LOCKED— plan without API — 403OPTED_OUT— 403NO_CREDITS— 402CONTACT_NOT_FOUND/UNKNOWN_EVENT— 404 / 400VALIDATION_ERROR— 400