WAHooks
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_token

Both 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

CodeMeaning
200Success
201Created (POST requests)
401Invalid or missing authentication
403Forbidden (resource belongs to another user)
404Resource not found
503Service 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

MethodEndpointDescription
GET/connectionsList all connections
POST/connectionsCreate a new connection
POST/connections/get-or-createGet a scannable connection (reuses idle or creates new)
GET/connections/:idGet connection details
PATCH/connections/:idUpdate connection (e.g. rename)
DELETE/connections/:idDelete a connection
POST/connections/:id/restartRestart a connection
GET/connections/:id/qrGet QR code for linking
GET/connections/:id/chatsGet recent chats
GET/connections/:id/meGet WhatsApp profile info
GET/connections/:id/media/:filenameProxy a media file from the WAHA worker (streams the file)

Messaging

MethodEndpointDescription
POST/connections/:id/sendSend a text message
POST/connections/:id/send-imageSend an image (URL or base64)
POST/connections/:id/send-documentSend a document/file
POST/connections/:id/send-videoSend a video
POST/connections/:id/send-audioSend audio/voice
POST/connections/:id/send-locationSend a location pin
POST/connections/:id/send-contactSend a contact card
POST/connections/:id/reactReact to a message with an emoji

The send endpoint accepts an optional replyTo field (message ID) to quote a specific message.

All send endpoints include human-like presence by default (read receipt, typing indicator, random delay). Pass skipPresence: true in the request body to disable this when handling presence yourself.

Presence

MethodEndpointDescription
POST/connections/:id/mark-readSend read receipt (blue ticks)
POST/connections/:id/typingStart typing indicator
POST/connections/:id/typing/stopStop typing indicator

All three accept { "chatId": "..." } in the request body.

Webhooks

MethodEndpointDescription
GET/connections/:cid/webhooksList webhooks for a connection
POST/connections/:cid/webhooksCreate a webhook
PUT/webhooks/:idUpdate a webhook
DELETE/webhooks/:idDelete a webhook
GET/webhooks/:id/logsGet delivery logs
POST/webhooks/:id/testSend a test event

API Tokens

MethodEndpointDescription
GET/tokensList active tokens
POST/tokensCreate a new token
DELETE/tokens/:idRevoke a token

Real-time Events

MethodEndpointDescription
WebSocket/ws?token=wh_...Real-time event stream. Receives all WAHA events for your connections. Auto-scoped to the authenticated user.

Connect with any WebSocket client. Events arrive as JSON:

{
  "event": "message",
  "connectionId": "c1a2b3c4-...",
  "payload": {
    "from": "1234567890@c.us",
    "body": "Hello"
  },
  "timestamp": "2026-03-27T12:00:00.000Z"
}

When a message includes media (image, video, document, audio), the payload contains hasMedia: true and a media object with a proxied URL you can fetch directly:

{
  "event": "message",
  "connectionId": "c1a2b3c4-...",
  "payload": {
    "from": "1234567890@c.us",
    "body": "Check this photo",
    "hasMedia": true,
    "media": {
      "url": "https://api.wahooks.com/api/connections/c1a2b3c4-.../media/photo.jpeg",
      "mimetype": "image/jpeg"
    }
  },
  "timestamp": "2026-03-27T12:00:00.000Z"
}

The media.url points to the media proxy endpoint (/connections/:id/media/:filename), which streams the file from the internal WAHA worker. The URL requires authentication (same Authorization header as other endpoints).

See the TypeScript SDK or Python SDK for client libraries.

Billing

MethodEndpointDescription
GET/billing/statusSubscription and slot status
GET/billing/can-createCheck if a new connection can be created
PUT/billing/slotsSet number of connection slots (charges immediately)
POST/billing/checkoutCreate Stripe checkout session (first-time setup)
POST/billing/portalOpen Stripe customer portal

Programmatic slot management

After completing checkout once (to add a payment method), you can scale slots entirely from code:

# Set to 10 slots — charges prorated difference immediately
curl -X PUT https://api.wahooks.com/api/billing/slots \
  -H "Authorization: Bearer wh_..." \
  -H "Content-Type: application/json" \
  -d '{"quantity": 10}'

Response:

{
  "slots": 10,
  "status": "upgraded",
  "proratedAmount": 2.25,
  "currency": "usd"
}
  • status: "upgraded", "downgraded", or "unchanged"
  • proratedAmount: the amount charged (positive) or credited (negative) immediately
  • Maximum 100 slots per account by default. Contact support for higher limits.
  • If payment fails, the request returns 400 and the subscription remains unchanged.

Other

MethodEndpointDescription
GET/Health check (no auth required)

On this page