API Reference
API Overview
WAHooks REST API reference
Base URL: https://api.wahooks.com/api
Authentication
All endpoints (except health check) require authentication via the Authorization header:
Authorization: Bearer wh_your_api_tokenBoth API tokens (wh_...) and Supabase JWTs are accepted. See API Tokens for details.
Response format
All responses are JSON. Successful responses return the resource directly. Errors return:
{
"message": "Connection not found",
"error": "Not Found",
"statusCode": 404
}Status codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created (POST requests) |
| 401 | Invalid or missing authentication |
| 403 | Forbidden (resource belongs to another user) |
| 404 | Resource not found |
| 503 | Service unavailable (worker still booting) |
Rate limiting
The API uses rate limiting to prevent abuse. If you exceed the rate limit, you'll receive a 429 response.
Connections
| Method | Endpoint | Description |
|---|---|---|
GET | /connections | List all connections |
POST | /connections | Create a new connection |
POST | /connections/get-or-create | Get a scannable connection (reuses idle or creates new) |
GET | /connections/:id | Get connection details |
PATCH | /connections/:id | Update connection (e.g. rename) |
DELETE | /connections/:id | Delete a connection |
POST | /connections/:id/restart | Restart a connection |
GET | /connections/:id/qr | Get QR code for linking |
GET | /connections/:id/chats | Get recent chats |
GET | /connections/:id/me | Get WhatsApp profile info |
Messaging
| Method | Endpoint | Description |
|---|---|---|
POST | /connections/:id/send | Send a text message |
POST | /connections/:id/send-image | Send an image (URL or base64) |
POST | /connections/:id/send-document | Send a document/file |
POST | /connections/:id/send-video | Send a video |
POST | /connections/:id/send-audio | Send audio/voice |
POST | /connections/:id/send-location | Send a location pin |
POST | /connections/:id/send-contact | Send a contact card |
Webhooks
| Method | Endpoint | Description |
|---|---|---|
GET | /connections/:cid/webhooks | List webhooks for a connection |
POST | /connections/:cid/webhooks | Create a webhook |
PUT | /webhooks/:id | Update a webhook |
DELETE | /webhooks/:id | Delete a webhook |
GET | /webhooks/:id/logs | Get delivery logs |
POST | /webhooks/:id/test | Send a test event |
API Tokens
| Method | Endpoint | Description |
|---|---|---|
GET | /tokens | List active tokens |
POST | /tokens | Create a new token |
DELETE | /tokens/:id | Revoke a token |
Other
| Method | Endpoint | Description |
|---|---|---|
GET | / | Health check (no auth required) |
GET | /billing/status | Subscription and slot status |
POST | /billing/checkout | Create Stripe checkout session |
POST | /billing/portal | Open Stripe customer portal |