Skip to main content

07 - API Specification

This document is source-verified against the controllers in apps/api/src/**/*.controller.ts as of MultiWA 1.0.0 (2026-05-24). For interactive exploration, use Swagger UI at <API base host>:<API port>/api/docs.

7.1 Overview

PropertyValue
Base URL (Docker)http://localhost:3333/api/v1
Base URL (local dev)http://localhost:3000/api/v1
Swagger UI<API host>:<port>/api/docs
Global prefixapi/v1 (from app.setGlobalPrefix('api/v1') in apps/api/src/main.ts)
FormatJSON
AuthBearer Token or x-api-key header

All endpoint paths in this document are relative to the base URL. For example, POST /messages/text resolves to POST http://localhost:3333/api/v1/messages/text under the Docker default.


7.2 Authentication

Bearer Token

Authorization: Bearer YOUR_JWT_TOKEN

Issued by POST /auth/register and POST /auth/login. Refresh with POST /auth/refresh.

API Key

x-api-key: YOUR_API_KEY

The Swagger UI registers the API key under the api-key security scheme; the header name is lowercase x-api-key. Create keys with POST /api-keys.


7.3 Response Format

Success Response

{
"success": true,
"data": { ... },
"meta": { "timestamp": "2026-02-05T10:00:00Z" }
}

Error Response

{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Phone number is required"
}
}

7.4 Endpoints

The tables below mirror the @Controller(...) decorators in apps/api/src/. Use them as the authoritative endpoint list; if Swagger and this document diverge, Swagger wins.

Auth (/auth)

MethodEndpointDescription
POST/auth/registerRegister an account and receive tokens
POST/auth/loginLog in and receive tokens
POST/auth/2fa/verifyVerify a 2FA challenge during login
POST/auth/refreshExchange refresh token for a new access token
POST/auth/logoutInvalidate the current session
GET/auth/meGet the current user
GET/auth/preferencesGet user preferences
PATCH/auth/preferencesUpdate user preferences
POST/auth/change-passwordChange the current user's password
DELETE/auth/accountDelete the current user account
POST/auth/2fa/setupBegin 2FA enrollment
POST/auth/2fa/enableConfirm and enable 2FA
POST/auth/2fa/disableDisable 2FA
POST/auth/2fa/backup-codesGenerate 2FA backup codes
GET/auth/sessionsList active sessions
DELETE/auth/sessions/:idRevoke a specific session
DELETE/auth/sessionsRevoke all sessions except current

Health (/health)

MethodEndpointDescription
GET/healthLiveness probe
GET/health/readyReadiness probe

Accounts (/accounts)

MethodEndpointDescription
GET/accountsList accounts
POST/accountsCreate account
GET/accounts/:idGet account
PUT/accounts/:idUpdate account
DELETE/accounts/:idDelete account
GET/accounts/:accountId/profilesList profiles inside an account
POST/accounts/:accountId/profilesCreate a profile in an account
GET/accounts/:accountId/profiles/:profileIdGet profile (account-scoped)
DELETE/accounts/:accountId/profiles/:profileIdDelete profile (account-scoped)
POST/accounts/:accountId/profiles/:profileId/connectStart WhatsApp connection
POST/accounts/:accountId/profiles/:profileId/disconnectDisconnect
GET/accounts/:accountId/profiles/:profileId/qrRetrieve current QR code

Profiles (/profiles) — flat alternative to the account-scoped routes

MethodEndpointDescription
GET/profilesList profiles
POST/profilesCreate profile
GET/profiles/:idGet profile
PUT/profiles/:idUpdate profile
DELETE/profiles/:idDelete profile
POST/profiles/:id/connectStart WhatsApp connection
POST/profiles/:id/disconnectDisconnect
GET/profiles/:id/statusGet connection status

The QR endpoint lives under the account-scoped /accounts/.../qr route, not on the flat /profiles resource.

Messages (/messages)

MethodEndpointDescription
POST/messages/textSend text message
POST/messages/otpSend an OTP with delivery-confirmed failover to a secondary channel
POST/messages/imageSend image
POST/messages/videoSend video
POST/messages/audioSend audio/voice
POST/messages/documentSend document
POST/messages/locationSend location
POST/messages/contactSend contact card
POST/messages/reactionSend a reaction
POST/messages/replySend a quoted reply
POST/messages/pollSend poll
POST/messages/typingSet typing presence
POST/messages/mark-readMark messages read
POST/messages/delete-for-everyoneDelete message for everyone
POST/messages/scheduleSchedule a message
GET/messages/schedule/:profileIdList scheduled messages for a profile
DELETE/messages/schedule/:idCancel a scheduled message
GET/messages/profile/:profileIdList messages for a profile
GET/messages/conversation/:conversationIdList messages in a conversation
GET/messages/conversation/:conversationId/load-olderFetch older messages from WhatsApp and persist them
GET/messages/:idGet a single message
DELETE/messages/:idDelete a message locally

Bulk Messaging (/bulk)

MethodEndpointDescription
POST/bulk/sendSend bulk messages with variables
GET/bulk/batchesList batches
GET/bulk/batch/:batchIdGet batch status
POST/bulk/batch/:batchId/cancelCancel batch

Broadcast (/broadcast)

MethodEndpointDescription
POST/broadcastCreate a broadcast campaign
GET/broadcastList broadcasts
GET/broadcast/:idGet broadcast
PUT/broadcast/:idUpdate broadcast
DELETE/broadcast/:idDelete broadcast
POST/broadcast/:id/scheduleSchedule broadcast
POST/broadcast/:id/startStart broadcast immediately
POST/broadcast/:id/pausePause broadcast
POST/broadcast/:id/resumeResume broadcast
POST/broadcast/:id/cancelCancel broadcast
GET/broadcast/:id/statsBroadcast delivery stats
GET/broadcast/:id/recipientsBroadcast recipient list

Groups (/groups)

MethodEndpointDescription
GET/groups/profile/:profileIdList groups for a profile
GET/groups/:groupIdGet group info
POST/groupsCreate group
PATCH/groups/:groupIdUpdate group
POST/groups/:groupId/participants/addAdd participants
POST/groups/:groupId/participants/removeRemove participants
POST/groups/:groupId/participants/promotePromote to admin
POST/groups/:groupId/participants/demoteDemote from admin
POST/groups/:groupId/leaveLeave group
GET/groups/:groupId/invite-linkGet invite link
POST/groups/:groupId/invite-link/revokeRevoke invite link

Conversations (/conversations)

MethodEndpointDescription
GET/conversationsList conversations
GET/conversations/unread-countTotal unread message count across the org
GET/conversations/:idGet conversation
GET/conversations/:id/messagesList messages in conversation
PUT/conversations/:id/readMark conversation read
PUT/conversations/:id/archiveArchive
PUT/conversations/:id/unarchiveUnarchive
PUT/conversations/:id/muteMute
PUT/conversations/:id/pinPin
DELETE/conversations/:idDelete conversation
DELETE/conversations/:id/messagesClear messages in conversation

Contacts (/contacts)

MethodEndpointDescription
GET/contactsList contacts
POST/contactsCreate contact
GET/contacts/:idGet contact
PUT/contacts/:idUpdate contact
DELETE/contacts/:idDelete contact
POST/contacts/importImport contacts
POST/contacts/import/csvImport contacts from CSV
GET/contacts/export/csvExport contacts as CSV
POST/contacts/:id/tagsAdd tags
DELETE/contacts/:id/tagsRemove tags
GET/contacts/profile/:profileId/validate/:phoneValidate a single phone number on WhatsApp
POST/contacts/profile/:profileId/validateValidate a batch of phone numbers
POST/contacts/sync/whatsappSync contacts from WhatsApp
POST/contacts/profile/:profileId/save-to-whatsappSave a contact into the WhatsApp account addressbook (whatsapp-web-js only)
DELETE/contacts/profile/:profileId/whatsapp/:phoneDelete a contact from the WhatsApp account addressbook (whatsapp-web-js only)

Templates (/templates)

MethodEndpointDescription
POST/templatesCreate template
GET/templatesList templates
GET/templates/:idGet template
PUT/templates/:idUpdate template
DELETE/templates/:idDelete template
POST/templates/:id/previewRender preview with variables
POST/templates/:id/duplicateDuplicate template

Webhooks (/webhooks)

MethodEndpointDescription
POST/webhooksCreate webhook
GET/webhooksList webhooks
GET/webhooks/:idGet webhook
PUT/webhooks/:idUpdate webhook
DELETE/webhooks/:idDelete webhook
POST/webhooks/:id/testSend a test event

Removed: the legacy global /hooks registry has been retired. Use the organization-scoped /webhooks endpoints above — they sign every delivery with an HMAC X-MultiWA-Signature header and are isolated per tenant.

Automation (/automation)

MethodEndpointDescription
POST/automationCreate automation flow
GET/automationList automation flows
GET/automation/:idGet flow
PUT/automation/:idUpdate flow
DELETE/automation/:idDelete flow
PUT/automation/:id/toggleToggle active flag
POST/automation/:id/testTest a flow with sample input
GET/automation/:id/statsFlow execution stats
POST/automation/reorderReorder flows

Auto-reply (/autoreply)

MethodEndpointDescription
POST/autoreply/quick-repliesCreate a quick reply
GET/autoreply/quick-repliesList quick replies
DELETE/autoreply/quick-replies/:idDelete a quick reply
POST/autoreplyCreate an auto-reply rule
GET/autoreplyList auto-reply rules
GET/autoreply/:idGet rule
PUT/autoreply/:idUpdate rule
DELETE/autoreply/:idDelete rule
PUT/autoreply/:id/toggleToggle active flag
POST/autoreply/webhook-replyConfigure webhook-driven reply
GET/autoreply/webhook-reply/:profileIdGet webhook-reply config
POST/autoreply/ai-hookConfigure AI-driven reply
GET/autoreply/ai-hook/:profileIdGet AI-hook config

AI (/ai and /ai/knowledge)

MethodEndpointDescription
GET/ai/statusAI provider status
POST/ai/completeGeneric completion
POST/ai/auto-replyGenerate an auto-reply suggestion
POST/ai/sentimentSentiment scoring
POST/ai/translateTranslate text
POST/ai/knowledge/:profileId/textIngest text into the knowledge base
GET/ai/knowledge/:profileIdList knowledge documents
DELETE/ai/knowledge/:idDelete a knowledge document
POST/ai/knowledge/:profileId/searchSearch the knowledge base

API Keys (/api-keys)

MethodEndpointDescription
GET/api-keysList API keys
POST/api-keysCreate API key
DELETE/api-keys/:idRevoke API key

Settings (/settings)

MethodEndpointDescription
GET/settings/storageGet storage settings
PUT/settings/storageUpdate storage settings
POST/settings/storage/testTest storage configuration
GET/settings/smtpGet SMTP settings
PUT/settings/smtpUpdate SMTP settings
POST/settings/smtp/testTest SMTP configuration

Uploads (/uploads)

MethodEndpointDescription
POST/uploads/mediaUpload media for use in messages

Integrations (/integrations)

MethodEndpointDescription
GET/integrations/configGet integration config
PUT/integrations/configUpdate integration config
POST/integrations/testTest integration connectivity

Statistics (/statistics)

MethodEndpointDescription
GET/statistics/dashboardDashboard summary
GET/statistics/messagesMessage totals
GET/statistics/messages/trendMessage volume trend
GET/statistics/contactsContact stats
GET/statistics/broadcastsBroadcast stats
GET/statistics/automationsAutomation stats
GET/statistics/response-timeResponse-time stats

Audit (/audit)

MethodEndpointDescription
GET/audit/logsList audit log entries
GET/audit/summaryAudit summary
GET/audit/actionsAudit action catalog

Notifications (/notifications)

MethodEndpointDescription
GET/notificationsList notifications
GET/notifications/unread-countUnread count
PATCH/notifications/:id/readMark a notification read
PATCH/notifications/read-allMark all read
DELETE/notifications/:idDelete one
DELETE/notificationsDelete all
GET/notifications/push/vapid-keyWeb Push VAPID public key
GET/notifications/push/subscriptionsList push subscriptions
POST/notifications/push/subscribeRegister a push subscription
POST/notifications/push/unsubscribeRemove a push subscription
POST/notifications/push/testSend a test push notification

Organizations (/organizations)

MethodEndpointDescription
GET/organizations/currentGet current organization
PUT/organizations/currentUpdate current organization
GET/organizations/membersList members
POST/organizations/membersInvite a member
PUT/organizations/members/:id/roleChange member role
DELETE/organizations/members/:idRemove member

Workspaces (/workspaces)

MethodEndpointDescription
GET/workspacesList workspaces
POST/workspacesCreate workspace
GET/workspaces/:idGet workspace
PUT/workspaces/:idUpdate workspace
DELETE/workspaces/:idDelete workspace

RBAC (/rbac)

MethodEndpointDescription
GET/rbac/permissionsList permissions
POST/rbac/rolesCreate role
GET/rbac/rolesList roles
GET/rbac/roles/:idGet role
PUT/rbac/roles/:idUpdate role
DELETE/rbac/roles/:idDelete role
POST/rbac/assignAssign role to user
DELETE/rbac/users/:userId/organizations/:orgIdUnassign user from organization
GET/rbac/users/:userId/rolesList user roles
GET/rbac/users/:userId/permissionsList user permissions
POST/rbac/organizations/:id/seedSeed default roles for an organization

GDPR (/account)

MethodEndpointDescription
GET/account/exportExport personal data
DELETE/account/deleteDelete account and personal data

7.5 Example: Send Bulk with Variables

curl -X POST http://localhost:3333/api/v1/bulk/send \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"profileId": "profile-123",
"messages": [
{
"chatId": "628123456789@c.us",
"type": "text",
"content": { "text": "Hello {name}!" },
"variables": { "name": "John" }
},
{
"chatId": "628987654321@c.us",
"type": "text",
"content": { "text": "Hello {name}!" },
"variables": { "name": "Jane" }
}
],
"options": {
"delayBetweenMessages": 5000,
"randomizeDelay": true
}
}'

← Engine Abstraction · Documentation Index · WebSocket API →