API Documentation
Complete reference for the WAPI WhatsApp Business API Gateway REST API
API Overview
The WAPI REST API provides a secure, multi-tenant gateway for integrating WhatsApp Business API into your applications. All endpoints use JSON for request and response bodies.
Base URL
https://api.wapi.co.zaFor local development: http://localhost:8080
API Version
All endpoints are versioned under /v1. The current version is v1.0.0.
Content Type
All API requests must include Content-Type: application/json header. All responses are returned as JSON.
Authentication
WAPI uses Bearer token authentication. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYTenant API Key
Used for tenant-specific operations like sending messages.
- Created via
POST /v1/tenants/{tenantID}/keys - Format:
wapi_test_...orwapi_live_... - Required for all
/v1/messages/*endpoints - Scoped to a specific tenant
Quick Start
Step 1: Create a Tenant API Key
With your tenant ID provided, you can create an API key (save this - it's only shown once!):
curl -X POST https://api.wapi.co.za/v1/tenants/{tenantID}/keys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production Key",
"env": "live"
}'Step 2: Send a Message
Use the tenant API key to send a WhatsApp message:
curl -X POST https://api.wapi.co.za/v1/messages/send \
-H "Authorization: Bearer wapi_live_YOUR_TENANT_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-request-id-123" \
-d '{
"number_to": "+1234567890",
"template": "hello_world",
"template_params": {}
}'API Endpoints
API Key Management
/v1/tenants/{id}/keys Tenant KeyCreate a tenant API key
/v1/tenants/{id}/keys Tenant KeyList tenant API keys
Messages
/v1/messages/send Tenant KeySend a WhatsApp message
/v1/messages Tenant KeyList messages
/v1/messages/{id} Tenant KeyGet message status
