API Documentation
Full API reference โ all endpoints your key can reach
Sections
Base URL
https://api.harakaflow.com/api/v1Authentication
Pass one of these on every request (except GET /billing/plans which is public):
Authorization: Bearer <JWT token> # โ or โ X-API-Key: gapi_xxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
API keys are created in Settings โ API Keys. JWT tokens come from the Google OAuth login flow.
Queue behavior
All messages are processed asynchronously via a Redis-backed queue. Your API call returns immediately with a jobId โ the actual send happens in the background.
- Per-session lock: Only 1 message per session is processed at a time. If a session is busy, queued jobs for it automatically wait and retry โ no messages are dropped.
- Anti-ban delay: 5โ15 s random wait between sends per session.
- Priority levels:
1= high (bot replies, jump the queue) ยท5= normal (default) ยท10= bulk (always last). Bot replies always process before bulk campaigns. - Retries: Failed sends are retried up to 3 times with exponential backoff (5 s โ 10 s โ 20 s).
/messages/sendAPI key โSend a WhatsApp message to a single recipient. Supports text, image, file, audio, video. Returns immediately with a jobId โ actual delivery is asynchronous. For bot replies, set priority=1 so the message jumps ahead of any queued bulk campaign.
Request Body
{
"sessionId": "uuid",
"to": "1234567890",
"message": "Hello!",
"type": "text",
"mediaUrl": "https://example.com/image.jpg (optional)",
"mediaCaption": "optional caption",
"scheduledAt": "2026-04-20T10:00:00Z (optional)",
"priority": "1 = high (bot reply) | 5 = normal (default) | 10 = bulk"
}/messages/bulkAPI key โQueue a bulk campaign to multiple recipients. Jobs are assigned the lowest priority (10) so real-time bot replies from the same session are never blocked. Per-session lock ensures messages send one at a time with anti-ban delays.
Request Body
{
"sessionId": "uuid",
"recipients": [
{
"phone": "1234567890",
"message": "Hi {{name}}!",
"variables": {
"name": "Alice"
}
}
],
"defaultMessage": "Hello!",
"delayMin": 5000,
"delayMax": 15000
}/messages/bulk/csvAPI key โSend bulk messages from a CSV file (phone, message columns). Multipart form upload.
/messagesAPI key โList messages with filtering and pagination.
Query Parameters
pagePage number (default 1)limitResults per page (default 20, max 100)statusFilter by status: queued | sending | sent | delivered | read | failed | receivedsessionIdFilter by session UUIDtoFilter by recipient phone number/messages/:idAPI key โGet a single message by ID.
/messages/:idAPI key โCancel a queued message (only if still in queue, not yet sent).
/messages/statsMessage statistics for a time period.
Query Parameters
period24h | 7d | 30d (default 7d)/messages/conversationsAPI key โList recent conversations grouped by recipient.
Query Parameters
limitNumber of conversations (default 20)sessionIdFilter by session UUID