WAPI Logo
WAPI

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.za

For 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_KEY

Tenant API Key

Used for tenant-specific operations like sending messages.

  • Created via POST /v1/tenants/{tenantID}/keys
  • Format: wapi_test_... or wapi_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

POST /v1/tenants/{id}/keys Tenant Key

Create a tenant API key

GET /v1/tenants/{id}/keys Tenant Key

List tenant API keys

Messages

POST /v1/messages/send Tenant Key

Send a WhatsApp message

GET /v1/messages Tenant Key

List messages

GET /v1/messages/{id} Tenant Key

Get message status