Developer-First API Gateway
← Back to the Developer Hub for quickstart & integration guides
Integrate WhatsApp messaging into any application with our RESTful API.
REST APIAPI Key AuthRate LimitedWebhooks
Quick Start
Authentication
curl -X POST https://api.chatreach.co.za/api/v1/gateway/send/text \
-H "X-Api-Key: wab_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"phoneLineId": "your-line-guid",
"to": "27821234567",
"body": "Hello from ChatReach!"
}'
Available Endpoints
API Gateway (requires X-Api-Key header)
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/gateway/send/text | Send a text message |
| POST | /api/v1/gateway/send/template | Send a template message |
| POST | /api/v1/gateway/send/media | Send image, video, audio, or document |
| POST | /api/v1/gateway/send/interactive | Send buttons or list menus |
| GET | /api/v1/gateway/messages/{phone}?take=50 | Get conversation history |
| GET | /api/v1/gateway/templates | List approved templates |
| GET | /api/v1/gateway/ping | Health check / validate key |
| POST | /api/v1/gateway/send/flow | Send a WhatsApp Flow message |
| POST | /api/v1/gateway/send/reaction | Send/remove emoji reaction |
| POST | /api/v1/gateway/send/contacts | Send contact cards |
| POST | /api/v1/gateway/send/sticker | Send a sticker |
| POST | /api/v1/gateway/send/product | Send single product message |
| POST | /api/v1/gateway/send/product-list | Send multi-product list |
| POST | /api/v1/gateway/send/location-request | Request customer location |
Internal API (requires JWT Bearer token)
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/login | Login and receive JWT + refresh token |
| POST | /api/auth/register | Register new user |
| POST | /api/auth/forgot-password | Request password reset token |
| POST | /api/auth/reset-password | Reset password with token |
| POST | /api/auth/change-password | Change password (authenticated) |
| GET | /api/tenants/{id} | Get tenant details |
| POST | /api/tenants/config | Set WhatsApp credentials |
| GET | /api/customers/{tenantId} | List customers (paginated, filterable) |
| GET | /api/team/{tenantId} | List team members |
| POST | /api/apikeys | Generate new API key |
| GET | /api/billing/plans | List billing plans |
| GET | /api/billing/invoices/{tenantId} | Get invoices |
| GET | /api/reports/usage/{tenantId} | Full usage analytics |
| GET | /api/sla/incidents/{tenantId} | SLA incidents |
| GET | /api/automations | List automations |
| POST | /api/automations | Create automation |
| POST | /api/automations/{id}/toggle | Activate/pause automation |
| POST | /api/automations/{id}/trigger | Trigger automation for a contact ({"phone":"27..."}) |
| GET | /api/campaigns | List campaigns |
| POST | /api/campaigns | Create/schedule campaign |
| GET | /api/ctwa/leads | Click-to-WhatsApp ad leads |
| GET | /api/ctwa/stats | CTWA performance stats |
| GET | /api/integrations/webhooks | List outbound webhooks |
| POST | /api/integrations/webhooks | Create outbound webhook |
| POST | /api/commerce/carts/shopify/{tenantId} | Shopify abandoned checkout webhook |
| POST | /api/commerce/carts/custom/{tenantId} | Custom store cart ingestion |
| POST | /api/commerce/orders/custom/{tenantId} | Mark carts recovered on purchase |
| GET | /api/commerce/catalog/products | Meta catalog products |
| POST | /api/commerce/capi/purchase | Fire Conversions API purchase event |
| GET | /api/commerce/carts | List abandoned carts |
| POST | /api/approvals | Send media for WhatsApp approval (single/bulk) |
| GET | /api/approvals | List approvals (filter: batchId, externalRef, status) |
| GET | /api/approvals/{id} | Approval status + rejection reason |
| POST | /api/interactions | Flexible interactive request (any buttons/list + reply capture) |
| GET | /api/interactions/{id} | Interaction status + selected option + captured replies |
| POST | /api/interactions/{id}/complete | Close capture window |
| GET | /api/crm/contacts/{phone} | Contact profile + analytics |
| POST | /api/crm/contacts/{phone}/link | Link CRM customer ID |
| GET | /api/crm/contacts/{phone}/notes | Read internal notes |
| POST | /api/crm/contacts/{phone}/notes | Add note from CRM |
Outbound Webhooks (CRM Sync)
Subscribe your CRM or any external system to ChatReach events. We POST a signed JSON payload to your endpoint whenever the event fires. Works with Zapier, Make.com, n8n, HubSpot, Salesforce, or custom endpoints.
POST /api/integrations/webhooks
{ "name": "HubSpot Sync", "url": "https://your-endpoint.com/hook", "events": "message.received,contact.created" }
// Every event is delivered as:
{
"event": "message.received",
"timestamp": 1747666800,
"tenantId": "...",
"data": { "contactId": "...", "phone": "27821234567", "body": "Hi!" }
}
// Verify authenticity — X-ChatReach-Signature header:
// HMAC-SHA256(rawBody, yourSigningSecret) as "sha256=hex"
Events: message.received, message.sent, message.status, contact.created, contact.updated, campaign.completed, automation.completed, ctwa.lead.created — or * for all. Failed deliveries retry 3 times with backoff.
Send Template Example
POST /api/v1/gateway/send/template
{
"phoneLineId": "guid-of-your-sales-line",
"to": "27821234567",
"templateName": "order_shipped",
"languageCode": "en_US",
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "John" },
{ "type": "text", "text": "ORD-4521" }
]
}
]
}
Rate Limits & Security
Each API key has a configurable rate limit (default 60 req/min). You can also restrict keys to specific IP addresses. All requests are logged with response times for full visibility.