WhatsApp CRMv1.6.0-beta.1

For the most up-to-date API reference and interactive testing, please check the Swagger UI or the Dashboard API Docs.

WhatsApp CRM API Documentation

WhatsApp AI Gateway — Complete API Reference

Professional WhatsApp Gateway REST API with 81 routes for complete WhatsApp automation.

šŸ” Authentication

All endpoints require one of the following authentication methods:

MethodHeader / CookieExample
API Key X-API-Key (header) X-API-Key: your-api-key-here
Session Cookie next-auth.session-token (cookie)Automatically managed by browser

šŸ“‹ Common Parameters

ParameterFormatExample
sessionIdUnique session identifier session-01
jid (Personal) {countryCode}{number}@s.whatsapp.net 628123456789@s.whatsapp.net
jid (Group) {groupId}@g.us 120363123456789@g.us

šŸ“‚ Media

[GET] /media/{filename}

Get uploaded media file

Parameters

NameLocated inRequiredTypeDescription
filenamepathāœ… Yesstring—

Responses

CodeDescription
200File data

cURL Example

bash
curl -X GET "http://localhost:3000/api/media/image.jpg" \ -H "X-API-Key: your-api-key"

šŸ“‚ Groups

[POST] /groups/{sessionId}/{jid}/leave

Leave a group

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Responses

CodeDescription
200Left the group successfully

cURL Example

bash
curl -X POST "http://localhost:3000/api/groups/session-01/628123456789@s.whatsapp.net/leave" \ -H "X-API-Key: your-api-key"

[GET] /groups/{sessionId}

List all groups

Get all groups associated with the session

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200List of groups
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Resource not found
500Failed to fetch groups

Response Example ( 200):

json
[ { "id": "string", "subject": "string", "desc": "string", "owner": "string", "size": 0, "isCommunity": true, "linkedParentJid": "string", "participants": [ { "id": "string", "admin": "string" } ] } ]

cURL Example

bash
curl -X GET "http://localhost:3000/api/groups/session-01" \ -H "X-API-Key: your-api-key"

[POST] /groups/{sessionId}/create

Create new group

Create a new group with specified participants

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
subjectstringāœ… Yes—
participantsarray of stringāœ… Yes—

Example:

json
{ "subject": "VIP Customers", "participants": [ "628123456789@s.whatsapp.net" ] }

Responses

CodeDescription
200Group created
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to create group
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
groupobjectNo—

Response Example ( 200):

json
{ "success": true, "group": { "id": "string", "subject": "string", "desc": "string", "owner": "string", "size": 0, "isCommunity": true, "linkedParentJid": "string", "participants": [ { "id": "string", "admin": "string" } ] } }

cURL Example

bash
curl -X POST "http://localhost:3000/api/groups/session-01/create" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"subject":"VIP Customers","participants":["628123456789@s.whatsapp.net"]}'

[PUT] /groups/{sessionId}/{jid}/subject

Update group subject

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
subjectstringāœ… Yes—

Example:

json
{ "subject": "string" }

Responses

CodeDescription
200Subject updated
400Invalid subject
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to update subject

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—
subjectstringNo—

Response Example ( 200):

json
{ "success": true, "message": "string", "subject": "string" }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/groups/session-01/628123456789@s.whatsapp.net/subject" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"subject":"string"}'

[PUT] /groups/{jid}/subject

Update group name

Update group subject (max 100 characters, requires admin)

Parameters

NameLocated inRequiredTypeDescription
jidpathāœ… YesstringURL-encoded group JID

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
sessionIdstringāœ… Yes—
subjectstringāœ… Yes—

Example:

json
{ "sessionId": "string", "subject": "string" }

Responses

CodeDescription
200Subject updated
400Invalid request (missing fields or subject too long)
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to update group subject
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—
subjectstringNo—

Response Example ( 200):

json
{ "success": true, "message": "Group subject updated successfully", "subject": "New Subject" }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/groups/628123456789@s.whatsapp.net/subject" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"sessionId":"string","subject":"string"}'

[PUT] /groups/{sessionId}/{jid}/members

Manage group members

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
actionstringāœ… YesOptions: add, remove, promote, demote
participantsarray of stringāœ… Yes—

Example:

json
{ "action": "add", "participants": [ "string" ] }

Responses

CodeDescription
200Members updated
400Invalid action
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to update members

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—
resultarray of objectNo—

Response Example ( 200):

json
{ "success": true, "message": "string", "result": [ { "text": "Hello from WhatsApp CRM!" } ] }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/groups/session-01/628123456789@s.whatsapp.net/members" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"action":"add","participants":["string"]}'

[PUT] /groups/{sessionId}/{jid}/invite

Revoke invite code

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Responses

CodeDescription
200Invite revoked
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to revoke code

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—
newInviteCodestringNo—
inviteUrlstringNo—

Response Example ( 200):

json
{ "success": true, "message": "string", "newInviteCode": "string", "inviteUrl": "string" }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/groups/session-01/628123456789@s.whatsapp.net/invite" \ -H "X-API-Key: your-api-key"

[GET] /groups/{sessionId}/{jid}/invite

Get invite code

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Responses

CodeDescription
200Invite code
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to get code

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
inviteCodestringNo—
inviteUrlstringNo—

Response Example ( 200):

json
{ "success": true, "inviteCode": "string", "inviteUrl": "string" }

cURL Example

bash
curl -X GET "http://localhost:3000/api/groups/session-01/628123456789@s.whatsapp.net/invite" \ -H "X-API-Key: your-api-key"

[GET] /groups/{sessionId}/{jid}

Get group details

Get detailed group information

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Responses

CodeDescription
200Group details
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Resource not found
500Failed to fetch details

Response Fields ( 200):

FieldTypeRequiredDescription
idstringNo—
subjectstringNo—
subjectOwnerstringNo—
subjectTimenumberNo—
descstringNo—
descOwnerstringNo—
descIdstringNo—
ownerstringNo—

Response Example ( 200):

json
{ "id": "string", "subject": "string", "subjectOwner": "string", "subjectTime": 0, "desc": "string", "descOwner": "string", "descId": "string", "owner": "string" }

cURL Example

bash
curl -X GET "http://localhost:3000/api/groups/session-01/628123456789@s.whatsapp.net" \ -H "X-API-Key: your-api-key"

[POST] /groups/{jid}/leave

Leave group

Parameters

NameLocated inRequiredTypeDescription
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
sessionIdstringāœ… Yes—

Example:

json
{ "sessionId": "string" }

Responses

CodeDescription
200Left group

cURL Example

bash
curl -X POST "http://localhost:3000/api/groups/628123456789@s.whatsapp.net/leave" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"sessionId":"string"}'

[POST] /groups/{sessionId}/invite/accept

Accept group invite

Join a group using an invite code

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
inviteCodestringāœ… Yes—

Example:

json
{ "inviteCode": "string" }

Responses

CodeDescription
200Group invite accepted
400Invalid/Expired code
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to accept invite
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—
groupJidstringNo—

Response Example ( 200):

json
{ "success": true, "message": "string", "groupJid": "string" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/groups/session-01/invite/accept" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"inviteCode":"string"}'

[DELETE] /groups/{sessionId}/{jid}/picture

Remove group picture

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Responses

CodeDescription
200Picture removed

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/groups/session-01/628123456789@s.whatsapp.net/picture" \ -H "X-API-Key: your-api-key"

[PUT] /groups/{sessionId}/{jid}/picture

Update group picture

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( multipart/form-data)

FieldTypeRequiredDescription
filestring (binary)āœ… Yes—

Example:

json
{ "file": "(binary)" }

Responses

CodeDescription
200Picture updated

cURL Example

bash
curl -X PUT "http://localhost:3000/api/groups/session-01/628123456789@s.whatsapp.net/picture" \ -H "X-API-Key: your-api-key" \ -F "file=@/path/to/file.jpg" \ -F "type=image" \ -F "caption=Hello"

[PUT] /groups/{sessionId}/{jid}/settings

Update group settings

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
settingstringāœ… Yesannouncement (admins only send), not_announcement (all send), locked (admins only edit), unlocked (all edit) Options: announcement, not_announcement, locked, unlocked
valuebooleanNoIgnored but required

Example:

json
{ "setting": "announcement", "value": true }

Responses

CodeDescription
200Settings updated

cURL Example

bash
curl -X PUT "http://localhost:3000/api/groups/session-01/628123456789@s.whatsapp.net/settings" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"setting":"announcement","value":true}'

[PUT] /groups/{sessionId}/{jid}/description

Update group description

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
descriptionstringNo—

Example:

json
{ "description": "string" }

Responses

CodeDescription
200Description updated
400Invalid input
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to update

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
descriptionstringNo—

Response Example ( 200):

json
{ "success": true, "description": "string" }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/groups/session-01/628123456789@s.whatsapp.net/description" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"description":"string"}'

[PUT] /groups/{sessionId}/{jid}/ephemeral

Toggle disappearing messages

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
expirationintegerāœ… YesOptions: 0, 86400, 604800, 7776000

Example:

json
{ "expiration": 0 }

Responses

CodeDescription
200Ephemeral toggled
400Invalid expiration
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to toggle

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
expirationintegerNo—

Response Example ( 200):

json
{ "success": true, "expiration": 0 }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/groups/session-01/628123456789@s.whatsapp.net/ephemeral" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"expiration":0}'

šŸ“‚ Documentation

[GET] /docs

Get Swagger JSON specification

Responses

CodeDescription
200Swagger JSON spec

cURL Example

bash
curl -X GET "http://localhost:3000/api/docs" \ -H "X-API-Key: your-api-key"

šŸ“‚ Chats

[GET] /chats/by-label/{labelId}

Get chats by label ID

Parameters

NameLocated inRequiredTypeDescription
labelIdpathāœ… Yesstring—

Responses

CodeDescription
200List of chats with the label

cURL Example

bash
curl -X GET "http://localhost:3000/api/chats/by-label/label_01" \ -H "X-API-Key: your-api-key"

šŸ“‚ Web Authentication

[POST] /auth/register

Register a new user

Register a user via web.

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
namestringāœ… Yes—
emailstringāœ… Yes—
passwordstringāœ… Yes—

Example:

json
{ "name": "John Doe", "email": "john@example.com", "password": "password123" }

Responses

CodeDescription
200User registered

cURL Example

bash
curl -X POST "http://localhost:3000/api/auth/register" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"name":"John Doe","email":"john@example.com","password":"password123"}'

[GET] /auth/session

Get current web session

Check if the user is authenticated in the web dashboard

Responses

CodeDescription
200Current session

Response Fields ( 200):

FieldTypeRequiredDescription
userobjectNo—
expiresstringNo—

Response Example ( 200):

json
{ "user": { "name": "string", "email": "string", "image": "string" }, "expires": "string" }

cURL Example

bash
curl -X GET "http://localhost:3000/api/auth/session" \ -H "X-API-Key: your-api-key"

[GET] /auth/csrf

Get CSRF token

Retrieve CSRF token for form submissions

Responses

CodeDescription
200CSRF Token

Response Fields ( 200):

FieldTypeRequiredDescription
csrfTokenstringNo—

Response Example ( 200):

json
{ "csrfToken": "string" }

cURL Example

bash
curl -X GET "http://localhost:3000/api/auth/csrf" \ -H "X-API-Key: your-api-key"

šŸ“‚ Sessions

[GET] /sessions

List all accessible sessions

Get all sessions accessible to the authenticated user (role-based filtering)

Responses

CodeDescription
200List of sessions
401Unauthorized - Invalid or missing API key

Response Example ( 200):

json
[ { "id": "clx123abc", "name": "Marketing Bot", "sessionId": "marketing-1", "status": "Connected", "userId": "string", "botConfig": { "text": "Hello from WhatsApp CRM!" }, "webhooks": [ { "text": "Hello from WhatsApp CRM!" } ], "_count": { "contacts": 0, "messages": 0, "groups": 0, "autoReplies": 0, "scheduledMessages": 0 }, "createdAt": "2026-01-15T08:00:00.000Z", "updatedAt": "2026-01-15T08:00:00.000Z" } ]

cURL Example

bash
curl -X GET "http://localhost:3000/api/sessions" \ -H "X-API-Key: your-api-key"

[POST] /sessions

Create new WhatsApp session

Creates a new WhatsApp session for QR code pairing

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
namestringāœ… YesDisplay name for the session
sessionIdstringNoUnique session ID (auto-generated if not provided)

Example:

json
{ "name": "Marketing Bot", "sessionId": "marketing-1" }

Responses

CodeDescription
200Session created successfully
400Invalid request body
401Unauthorized - Invalid or missing API key

Response Fields ( 200):

FieldTypeRequiredDescription
idstringNo—
namestringNo—
sessionIdstringNo—
statusstringNoOptions: Connected, Disconnected, Connecting
userIdstringNo—
botConfigobject, nullableNo—
webhooksarray of objectNo—
_countobject, nullableNo—
createdAtstring (date-time)No—
updatedAtstring (date-time)No—

Response Example ( 200):

json
{ "id": "clx123abc", "name": "Marketing Bot", "sessionId": "marketing-1", "status": "Connected", "userId": "string", "botConfig": { "text": "Hello from WhatsApp CRM!" }, "webhooks": [ { "text": "Hello from WhatsApp CRM!" } ], "_count": { "contacts": 0, "messages": 0, "groups": 0, "autoReplies": 0, "scheduledMessages": 0 }, "createdAt": "2026-01-15T08:00:00.000Z", "updatedAt": "2026-01-15T08:00:00.000Z" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/sessions" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"name":"Marketing Bot","sessionId":"marketing-1"}'

[GET] /sessions/{id}/qr

Get QR code for pairing

Retrieve QR code (string and base64 image) for WhatsApp pairing

Parameters

NameLocated inRequiredTypeDescription
idpathāœ… YesstringSession ID

Responses

CodeDescription
200QR code generated
400Already connected
404QR not available yet

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
qrstringNoQR code string
base64stringNoBase64 data URL for image

Response Example ( 200):

json
{ "status": true, "message": "QR code generated", "data": { "success": true, "qr": "2@AbCdEfGhIjKlMnOp...", "base64": "data:image/png;base64,iVBORw0KGgo..." } }

cURL Example

bash
curl -X GET "http://localhost:3000/api/sessions/sales-01/qr" \ -H "X-API-Key: your-api-key"

[GET] /sessions/{id}/bot-config

Get bot configuration

Parameters

NameLocated inRequiredTypeDescription
idpathāœ… Yesstring—

Responses

CodeDescription
200Bot configuration retrieved

cURL Example

bash
curl -X GET "http://localhost:3000/api/sessions/abc123/bot-config" \ -H "X-API-Key: your-api-key"

[POST] /sessions/{id}/bot-config

Update bot configuration

Parameters

NameLocated inRequiredTypeDescription
idpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
enabledbooleanNo—
botModestringNoOptions: OWNER, SPECIFIC, BLACKLIST, ALL
botAllowedJidsarray of stringNo—
botBlockedJidsarray of stringNo—
autoReplyModestringNoOptions: OWNER, SPECIFIC, BLACKLIST, ALL
autoReplyAllowedJidsarray of stringNo—
autoReplyBlockedJidsarray of stringNo—
botNamestringNo—
enableStickerbooleanNo—
enableVideoStickerbooleanNo—
maxStickerDurationintegerNo—
enablePingbooleanNo—
enableUptimebooleanNo—
removeBgApiKeystring, nullableNo—

Example:

json
{ "enabled": true, "botMode": "BLACKLIST", "botBlockedJids": [ "628123456789@s.whatsapp.net" ], "autoReplyMode": "SPECIFIC", "autoReplyAllowedJids": [ "628123456789@s.whatsapp.net" ], "botName": "My Assistant", "enableSticker": true }

Responses

CodeDescription
200Configuration updated
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Session not found
500Internal Server Error

Response Fields ( 200):

FieldTypeRequiredDescription
idstringNo—
sessionIdstringNo—
enabledbooleanNo—
botModestringNo—
botAllowedJidsarray of stringNo—
autoReplyModestringNo—
autoReplyAllowedJidsarray of stringNo—
botNamestringNo—
enableStickerbooleanNo—
enableVideoStickerbooleanNo—
maxStickerDurationintegerNo—
enablePingbooleanNo—
enableUptimebooleanNo—
removeBgApiKeystring, nullableNo—
createdAtstring (date-time)No—
updatedAtstring (date-time)No—

Response Example ( 200):

json
{ "id": "string", "sessionId": "string", "enabled": true, "botMode": "string", "botAllowedJids": [ "string" ], "autoReplyMode": "string", "autoReplyAllowedJids": [ "string" ], "botName": "string", "enableSticker": true, "enableVideoSticker": true, "maxStickerDuration": 0, "enablePing": true, "enableUptime": true, "removeBgApiKey": "string", "createdAt": "2026-01-15T08:00:00.000Z", "updatedAt": "2026-01-15T08:00:00.000Z" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/sessions/abc123/bot-config" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"enabled":true,"botMode":"BLACKLIST","botBlockedJids":["628123456789@s.whatsapp.net"],"autoReplyMode":"SPECIFIC","autoReplyAllowedJids":["628123456789@s.whatsapp.net"],"botName":"My Assistant","enableSticker":true}'

[GET] /sessions/{id}

Get session details

Get detailed information about a specific session including uptime and status

Parameters

NameLocated inRequiredTypeDescription
idpathāœ… Yesstring—

Responses

CodeDescription
200Session details
404Session not found

Response Example ( 200):

json
{ "id": "clx123abc", "name": "Marketing Bot", "sessionId": "marketing-1", "status": "Connected", "userId": "string", "botConfig": { "text": "Hello from WhatsApp CRM!" }, "webhooks": [ { "text": "Hello from WhatsApp CRM!" } ], "_count": { "contacts": 0, "messages": 0, "groups": 0, "autoReplies": 0, "scheduledMessages": 0 }, "createdAt": "2026-01-15T08:00:00.000Z", "updatedAt": "2026-01-15T08:00:00.000Z", "uptime": 0, "messageCount": 0, "hasInstance": true, "me": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X GET "http://localhost:3000/api/sessions/abc123" \ -H "X-API-Key: your-api-key"

[POST] /sessions/{id}/{action}

Perform session action

Start, stop, restart, or logout a session

Parameters

NameLocated inRequiredTypeDescription
idpathāœ… Yesstring—
actionpathāœ… YesstringOptions: start, stop, restart, logout

Responses

CodeDescription
200Action performed successfully
400Invalid action
500Action failed

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X POST "http://localhost:3000/api/sessions/abc123/start" \ -H "X-API-Key: your-api-key"

[PATCH] /sessions/{id}/settings

Update session settings

Parameters

NameLocated inRequiredTypeDescription
idpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
configobjectNo—

Example:

json
{ "config": { "readReceipts": true, "rejectCalls": true } }

Responses

CodeDescription
200Settings updated

cURL Example

bash
curl -X PATCH "http://localhost:3000/api/sessions/abc123/settings" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"config":{"readReceipts":true,"rejectCalls":true}}'

[DELETE] /sessions/{id}/settings

Delete session and logout

Permanently deletes session and logs out from WhatsApp

Parameters

NameLocated inRequiredTypeDescription
idpathāœ… Yesstring—

Responses

CodeDescription
200Session deleted

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/sessions/abc123/settings" \ -H "X-API-Key: your-api-key"

šŸ“‚ Session Access

[GET] /sessions/{sessionId}/access

List users with shared access

Get all users who have been granted access to the specified session. Only the session owner or SUPERADMIN can use this endpoint.

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… YesstringSession ID (slug or CUID)

Responses

CodeDescription
200Access list retrieved
401Unauthorized - Invalid or missing API key
403Forbidden - Only session owner can manage access
404Session not found

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataarray of objectNo—

Response Example ( 200):

json
{ "status": true, "message": "Access list retrieved successfully", "data": [ { "id": "string", "sessionId": "string", "userId": "string", "createdAt": "2026-01-15T08:00:00.000Z", "user": { "id": "string", "name": "string", "email": "string", "role": "string" } } ] }

cURL Example

bash
curl -X GET "http://localhost:3000/api/sessions/marketing-1/access" \ -H "X-API-Key: your-api-key"

[POST] /sessions/{sessionId}/access

Grant access to another user

Grant session access to another registered user by email. Only the session owner or SUPERADMIN can use this endpoint. Cannot grant access to the session owner or SUPERADMINs.

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… YesstringSession ID (slug or CUID)

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
emailstring (email)āœ… YesEmail of the user to grant access

Example:

json
{ "email": "staff@example.com" }

Responses

CodeDescription
201Access granted successfully
400Validation error / Cannot grant to owner / SUPERADMIN already has access
401Unauthorized - Invalid or missing API key
403Forbidden - Only session owner can manage access
404Session or user not found
409User already has access to this session

cURL Example

bash
curl -X POST "http://localhost:3000/api/sessions/marketing-1/access" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"email":"staff@example.com"}'

[DELETE] /sessions/{sessionId}/access

Revoke user access

Remove shared access for a user from the specified session. Only the session owner or SUPERADMIN can use this endpoint.

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… YesstringSession ID (slug or CUID)

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
userIdstringāœ… YesCUID of the user to revoke access from

Example:

json
{ "userId": "clx456ghi" }

Responses

CodeDescription
200Access revoked successfully
400Validation error
401Unauthorized - Invalid or missing API key
403Forbidden - Only session owner can manage access
404Session or access record not found

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/sessions/marketing-1/access" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"userId":"clx456ghi"}'

šŸ“‚ Messaging

[POST] /messages/{sessionId}/{jid}/send

Send message (text/media/sticker)

Universal endpoint for sending text, images, videos, documents, and stickers. Supports mentions and all WhatsApp message types.

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… YesstringSession identifier
jidpathāœ… YesstringRecipient JID

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
messageobjectāœ… YesMessage content (text, image, sticker, etc.)
mentionsarray of stringNoList of JIDs to mention (for group messages)

Example:

json
{ "message": { "text": "Hello from WhatsApp CRM!" }, "mentions": [ "628123456789@s.whatsapp.net" ] }

Responses

CodeDescription
200Message sent successfully
400Invalid request - jid and message are required
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Session not found or disconnected
500Failed to send message
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Message sent successfully", "data": { "key": { "remoteJid": "628123456789@s.whatsapp.net", "fromMe": true, "id": "3EB01234567890" }, "message": { "conversation": "Hello from WhatsApp CRM!" }, "messageTimestamp": "1678901234" } }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/sales-01/628123456789@s.whatsapp.net/send" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"message":{"text":"Hello from WhatsApp CRM!"},"mentions":["628123456789@s.whatsapp.net"]}'

[POST] /messages/{sessionId}/{jid}/media

Send media (image/video/audio/document)

Send file using multipart/form-data

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… YesstringSession identifier
jidpathāœ… YesstringRecipient JID

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( multipart/form-data)

FieldTypeRequiredDescription
filestring (binary)āœ… Yes—
typestringāœ… YesOptions: image, video, audio, voice, document, sticker Default: image
captionstringNo—

Example:

json
{ "file": "(binary)", "type": "image", "caption": "string" }

Responses

CodeDescription
200Media sent successfully
400Bad Request - File missing
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to send media
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/session-01/628123456789@s.whatsapp.net/media" \ -H "X-API-Key: your-api-key" \ -F "file=@/path/to/file.jpg" \ -F "type=image" \ -F "caption=Hello"

[POST] /messages/{sessionId}/broadcast

Broadcast message to multiple recipients

Send same message to multiple contacts with anti-ban delays (10-20s random)

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
recipientsarray of stringāœ… Yes—
messagestringāœ… Yes—
delaynumberNoOptional delay (unused)

Example:

json
{ "recipients": [ "628123456789@s.whatsapp.net", "628987654321@s.whatsapp.net" ], "message": "Flash Sale! 50% off", "delay": 0 }

Responses

CodeDescription
200Broadcast started
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to start broadcast
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "Broadcast started in background" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/session-01/broadcast" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"recipients":["628123456789@s.whatsapp.net","628987654321@s.whatsapp.net"],"message":"Flash Sale! 50% off","delay":0}'

[POST] /messages/{sessionId}/{jid}/poll

Send poll message

Create interactive poll (2-12 options, single or multiple choice)

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
questionstringāœ… Yes—
optionsarray of stringāœ… Yes—
selectableCountintegerNo—

Example:

json
{ "question": "What's your favorite product?", "options": [ "Product A", "Product B", "Product C" ], "selectableCount": 1 }

Responses

CodeDescription
200Poll sent
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to send poll
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—

Response Example ( 200):

json
{ "success": true }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/session-01/628123456789@s.whatsapp.net/poll" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"question":"What's your favorite product?","options":["Product A","Product B","Product C"],"selectableCount":1}'

[POST] /messages/{sessionId}/{jid}/location

Send location

Share GPS coordinates with optional name and address

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
latitudenumberāœ… Yes—
longitudenumberāœ… Yes—
namestringNo—
addressstringNo—

Example:

json
{ "latitude": -6.2088, "longitude": 106.8456, "name": "Central Park", "address": "Jakarta, Indonesia" }

Responses

CodeDescription
200Location sent
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to send location
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—

Response Example ( 200):

json
{ "success": true }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/session-01/628123456789@s.whatsapp.net/location" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"latitude":-6.2088,"longitude":106.8456,"name":"Central Park","address":"Jakarta, Indonesia"}'

[POST] /messages/{sessionId}/{jid}/contact

Send contact card

Share one or multiple contact vCards

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
contactsarray of objectāœ… Yes—

Example:

json
{ "contacts": [ { "displayName": "John Doe", "vcard": "BEGIN:VCARD..." } ] }

Responses

CodeDescription
200Contact sent
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to send contact
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—

Response Example ( 200):

json
{ "success": true }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/session-01/628123456789@s.whatsapp.net/contact" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"contacts":[{"displayName":"John Doe","vcard":"BEGIN:VCARD..."}]}'

[GET] /messages/{sessionId}/download/{messageId}/media

Download message media

Download media from a message (direct binary or redirect)

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
messageIdpathāœ… Yesstring—

Responses

CodeDescription
200Binary media file
401Unauthorized - Invalid or missing API key
403Forbidden - Cannot access session or message
404Message not found or has no media

cURL Example

bash
curl -X GET "http://localhost:3000/api/messages/session-01/download/MSG_ID_123/media" \ -H "X-API-Key: your-api-key"

[POST] /messages/{sessionId}/{jid}/{messageId}/react

React to message with emoji

Add emoji reaction to a message (empty string removes reaction)

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—
messageIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
emojistringāœ… YesEmoji or empty string to remove

Example:

json
{ "emoji": "šŸ‘" }

Responses

CodeDescription
200Reaction sent
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to send reaction
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "string" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/session-01/628123456789@s.whatsapp.net/MSG_ID_123/react" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"emoji":"šŸ‘"}'

[POST] /messages/{sessionId}/{jid}/{messageId}/reply

Reply to a message (quoted reply)

Send a quoted reply to a specific message by its ID. Uses same request format as /send — pass a Baileys message object.

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—
messageIdpathāœ… YesstringID of message to reply to

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
messageobjectāœ… YesMessage content — same format as /send (text, image, video, etc.)
mentionsarray of stringNoJIDs to mention
fromMebooleanNoWhether the quoted message was sent by you Default: false

Example:

json
{ "message": { "text": "Thanks for your message!" }, "mentions": [ "628123456789@s.whatsapp.net" ], "fromMe": true }

Responses

CodeDescription
200Reply sent successfully
400message is required
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to send reply
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "Message sent successfully" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/sales-01/628123456789@s.whatsapp.net/3EB0ABCD1234567890/reply" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"message":{"text":"Thanks for your message!"},"mentions":["628123456789@s.whatsapp.net"],"fromMe":true}'

[POST] /messages/{sessionId}/{jid}/reply

Reply to a message (body-based)

Send a quoted reply with messageId provided in the request body. Same request format as /send with added messageId.

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
messageIdstringāœ… YesID of the message to reply to
messageobjectāœ… YesMessage content — same format as /send (text, image, video, etc.)
mentionsarray of stringNoJIDs to mention
fromMebooleanNoWhether the quoted message was sent by you Default: false

Example:

json
{ "messageId": "3EB0ABCD1234567890", "message": { "text": "Sure, let me check that for you!" } }

Responses

CodeDescription
200Reply sent successfully
400messageId and message required
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to send reply
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/sales-01/628123456789@s.whatsapp.net/reply" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"messageId":"3EB0ABCD1234567890","message":{"text":"Sure, let me check that for you!"}}'

[POST] /messages/{sessionId}/{jid}/{messageId}/star

Star or unstar a message

Mark a message as starred (saved) or remove the star. Starred messages appear in the Starred Messages section.

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—
messageIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
starbooleanNotrue to star, false to unstar Default: true
fromMebooleanNoWhether the message was sent by you Default: false

Example:

json
{ "star": true, "fromMe": false }

Responses

CodeDescription
200Star status updated
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to star/unstar message
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "Message starred" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/session-01/628123456789@s.whatsapp.net/MSG_ID_123/star" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"star":true,"fromMe":false}'

Search messages

Search messages stored in the database for a session. Supports full-text search, filtering by JID, type, and sender.

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
qqueryNostringText to search for in message content
jidqueryNostringFilter by chat JID
typequeryNostringFilter by message type Options: TEXT, IMAGE, VIDEO, AUDIO, DOCUMENT, STICKER, LOCATION, CONTACT
fromMequeryNobooleanFilter by sender (true=outgoing, false=incoming)
pagequeryNointegerDefault: 1
limitqueryNointegerDefault: 20

Responses

CodeDescription
200Search results
400q or jid is required
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Session not found
500Failed to search messages

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
dataarray of objectNo—
paginationobjectNo—

Response Example ( 200):

json
{ "success": true, "data": [ { "id": "string", "remoteJid": "string", "fromMe": true, "keyId": "string", "pushName": "string", "type": "string", "content": "string", "status": "string", "timestamp": "2026-01-15T08:00:00.000Z", "quoteId": "string" } ], "pagination": { "total": 0, "page": 0, "limit": 0, "pages": 0 } }

cURL Example

bash
curl -X GET "http://localhost:3000/api/messages/sales-01/search?q=invoice&jid=628123456789@s.whatsapp.net&type=value&fromMe=value&page=value&limit=value" \ -H "X-API-Key: your-api-key"

[POST] /messages/{sessionId}/{jid}/list

Send list message

Send a formatted numbered list message

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
titlestringāœ… Yes—
optionsarray of stringāœ… Yes—
footerstringNo—

Example:

json
{ "title": "Our Services", "options": [ "Web Dev", "App Dev", "UI/UX" ], "footer": "Choose one" }

Responses

CodeDescription
200Message sent
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to send message
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—

Response Example ( 200):

json
{ "success": true }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/session-01/628123456789@s.whatsapp.net/list" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"title":"Our Services","options":["Web Dev","App Dev","UI/UX"],"footer":"Choose one"}'

[POST] /messages/{sessionId}/{jid}/spam

Message bombing (Spam)

Send a message multiple times in a row in the background

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
messagestringāœ… Yes—
countintegerNoDefault: 10
delayintegerNoDelay in ms Default: 500

Example:

json
{ "message": "Check our new catalog!", "count": 5, "delay": 1000 }

Responses

CodeDescription
200Spam started
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to start spam
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "string" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/session-01/628123456789@s.whatsapp.net/spam" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"message":"Check our new catalog!","count":5,"delay":1000}'

[POST] /messages/{sessionId}/{jid}/sticker

Send sticker

Convert an image to sticker and send it

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( multipart/form-data)

FieldTypeRequiredDescription
filestring (binary)āœ… Yes—
packstringNoSticker pack name (default: WhatsApp CRM)
authorstringNoSticker author name (default: User)
typestringNoSticker crop type (default: full) Options: full, crop, circle
qualityintegerNoImage quality (default: 50)

Example:

json
{ "file": "(binary)", "pack": "string", "author": "string", "type": "full", "quality": 0 }

Responses

CodeDescription
200Sticker sent
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to create sticker
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—

Response Example ( 200):

json
{ "success": true }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/session-01/628123456789@s.whatsapp.net/sticker" \ -H "X-API-Key: your-api-key" \ -F "file=@/path/to/file.jpg" \ -F "type=image" \ -F "caption=Hello"

[POST] /messages/{sessionId}/forward

Forward message

Forward a message to one or multiple chats

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
fromJidstringāœ… YesSource chat JID
messageIdstringāœ… Yes—
toJidsarray of stringāœ… YesRecipient JIDs

Example:

json
{ "fromJid": "628123456789@s.whatsapp.net", "messageId": "3EB0ABCD1234567890", "toJids": [ "628987654321@s.whatsapp.net" ] }

Responses

CodeDescription
200Message forwarded
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to forward message
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "string" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/messages/session-01/forward" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"fromJid":"628123456789@s.whatsapp.net","messageId":"3EB0ABCD1234567890","toJids":["628987654321@s.whatsapp.net"]}'

[DELETE] /messages/{sessionId}/{jid}/{messageId}

Delete message for everyone

Delete message (only works for messages < 7 minutes old)

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—
messageIdpathāœ… Yesstring—

Responses

CodeDescription
200Message deleted
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to delete message
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "Message deleted for everyone" }

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/messages/session-01/628123456789@s.whatsapp.net/MSG_ID_123" \ -H "X-API-Key: your-api-key"

[PATCH] /messages/{sessionId}/{jid}/{messageId}

Edit a sent message

Edit text of a sent message

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—
messageIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
textstringāœ… Yes—

Example:

json
{ "text": "Updated text message" }

Responses

CodeDescription
200Message edited
400Bad Request
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to edit message
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "status": true, "message": "Message edited successfully" }

cURL Example

bash
curl -X PATCH "http://localhost:3000/api/messages/session-01/628123456789@s.whatsapp.net/MSG_ID_123" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"text":"Updated text message"}'

šŸ“‚ Chat

[GET] /chat/{sessionId}

Get chat list with contacts

Retrieve all contacts with last message for a session

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200Chat list

Response Example ( 200):

json
[ { "jid": "628123456789@s.whatsapp.net", "name": "John Doe", "notify": "string", "profilePic": "string" } ]

cURL Example

bash
curl -X GET "http://localhost:3000/api/chat/session-01" \ -H "X-API-Key: your-api-key"

[GET] /chat/{sessionId}/{jid}

Get message history

Fetch up to 100 messages for a chat (enriched with participant info for groups)

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… YesstringURL-encoded JID

Responses

CodeDescription
200Message history (max 100 messages)

cURL Example

bash
curl -X GET "http://localhost:3000/api/chat/session-01/628123456789@s.whatsapp.net" \ -H "X-API-Key: your-api-key"

[PUT] /chat/{sessionId}/{jid}/read

Mark messages as read

Mark specific messages or entire chat as read using RESTful path parameters

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… YesstringSession identifier
jidpathāœ… YesstringURL-encoded WhatsApp JID

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
messageIdsarray of stringNoOptional: specific message IDs to mark as read. If not provided, marks entire chat as read

Example:

json
{ "messageIds": [ "string" ] }

Responses

CodeDescription
200Messages marked as read
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to mark messages as read
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "Messages marked as read" }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/chat/session-01/628123456789@s.whatsapp.net/read" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"messageIds":["string"]}'

[PUT] /chat/{sessionId}/{jid}/archive

Archive/unarchive chat

Archive or unarchive a chat using RESTful path parameters

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… YesstringURL-encoded JID

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
archivebooleanāœ… Yestrue to archive, false to unarchive

Example:

json
{ "archive": true }

Responses

CodeDescription
200Chat archived/unarchived
400Missing required fields
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to archive/unarchive chat
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "Chat archived" }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/chat/session-01/628123456789@s.whatsapp.net/archive" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"archive":true}'

[PUT] /chat/{sessionId}/{jid}/mute

Mute/unmute chat

Mute chat with optional duration (default 8 hours)

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… YesstringURL-encoded JID

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
mutebooleanāœ… Yes—
durationintegerNoDuration in seconds (default: 8 hours)

Example:

json
{ "mute": true, "duration": 3600 }

Responses

CodeDescription
200Chat muted/unmuted
400Missing required fields
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to mute/unmute chat
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "Chat muted" }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/chat/session-01/628123456789@s.whatsapp.net/mute" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"mute":true,"duration":3600}'

[PUT] /chat/{sessionId}/{jid}/pin

Pin/unpin chat

Pin or unpin a chat

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… YesstringURL-encoded JID

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
pinbooleanāœ… Yes—

Example:

json
{ "pin": true }

Responses

CodeDescription
200Chat pinned/unpinned
400Missing required fields
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to pin/unpin chat
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "Chat pinned" }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/chat/session-01/628123456789@s.whatsapp.net/pin" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"pin":true}'

[POST] /chat/{sessionId}/{jid}/presence

Send presence (typing/recording)

Send presence status (typing, recording, online, etc.) to a chat

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… YesstringURL-encoded JID

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
presencestringāœ… YesOptions: composing, recording, paused, available, unavailable

Example:

json
{ "presence": "composing" }

Responses

CodeDescription
200Presence sent
400Missing required fields or invalid presence
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to send presence
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "Presence 'composing' sent to 628123456789@s.whatsapp.net" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/chat/session-01/628123456789@s.whatsapp.net/presence" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"presence":"composing"}'

[POST] /chat/{sessionId}/{jid}/profile-picture

Get profile picture URL

Get profile picture URL for a contact or group

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… YesstringURL-encoded JID

Responses

CodeDescription
200Profile picture URL
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to fetch profile picture
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
jidstringNo—
profilePicUrlstring, nullableNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "jid": "628123456789@s.whatsapp.net", "profilePicUrl": "https://pps.whatsapp.net/...", "message": "No profile picture found" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/chat/session-01/628123456789@s.whatsapp.net/profile-picture" \ -H "X-API-Key: your-api-key"

[POST] /chat/{sessionId}/check

Check if numbers exist on WhatsApp

Validate phone numbers (max 50 per request)

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
numbersarray of stringāœ… Yes—

Example:

json
{ "numbers": [ "628123456789", "628987654321" ] }

Responses

CodeDescription
200Validation results
400Missing required fields
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to check numbers
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
resultsarray of objectNo—

Response Example ( 200):

json
{ "success": true, "results": [ { "number": "string", "exists": true, "jid": "string", "error": "string" } ] }

cURL Example

bash
curl -X POST "http://localhost:3000/api/chat/session-01/check" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"numbers":["628123456789","628987654321"]}'

šŸ“‚ Profile

[GET] /profile/{sessionId}

Get own profile

Fetch profile information of the connected WhatsApp account

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200Profile info
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
jidstringNo—
statusobjectNo—

Response Example ( 200):

json
{ "success": true, "jid": "string", "status": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X GET "http://localhost:3000/api/profile/session-01" \ -H "X-API-Key: your-api-key"

[PUT] /profile/{sessionId}/name

Update profile name

Update the WhatsApp display name (max 25 chars)

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
namestringāœ… Yes—

Example:

json
{ "name": "string" }

Responses

CodeDescription
200Name updated
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/profile/session-01/name" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"name":"string"}'

[PUT] /profile/{sessionId}/status

Update profile status

Update the WhatsApp about/status (max 139 chars)

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
statusstringāœ… Yes—

Example:

json
{ "status": "string" }

Responses

CodeDescription
200Status updated
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/profile/session-01/status" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"status":"string"}'

[DELETE] /profile/{sessionId}/picture

Remove profile picture

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200Picture removed
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/profile/session-01/picture" \ -H "X-API-Key: your-api-key"

[PUT] /profile/{sessionId}/picture

Update profile picture

Upload a new profile picture

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( multipart/form-data)

FieldTypeRequiredDescription
filestring (binary)āœ… Yes—

Example:

json
{ "file": "(binary)" }

Responses

CodeDescription
200Picture updated
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/profile/session-01/picture" \ -H "X-API-Key: your-api-key" \ -F "file=@/path/to/file.jpg" \ -F "type=image" \ -F "caption=Hello"

šŸ“‚ Auto Replies

[DELETE] /autoreplies/{sessionId}

Delete all autoreplies

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200Autoreplies deleted

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/autoreplies/session-01" \ -H "X-API-Key: your-api-key"

šŸ“‚ Auto Reply

[GET] /autoreplies/{sessionId}

List auto-reply rules

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200List of auto-reply rules
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Session not found

cURL Example

bash
curl -X GET "http://localhost:3000/api/autoreplies/session-01" \ -H "X-API-Key: your-api-key"

[POST] /autoreplies/{sessionId}

Create auto-reply rule

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
keywordstringāœ… Yes—
responsestringāœ… Yes—
matchTypestringNoOptions: EXACT, CONTAINS, STARTS_WITH, REGEX
isMediabooleanNo—
mediaUrlstringNo—
triggerTypestringNoOptions: ALL, GROUP, PRIVATE

Example:

json
{ "keyword": "hello", "response": "Hi there! How can I help?", "matchType": "EXACT", "triggerType": "ALL", "isMedia": false }

Responses

CodeDescription
200Rule created
400Missing required fields
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied

cURL Example

bash
curl -X POST "http://localhost:3000/api/autoreplies/session-01" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"keyword":"hello","response":"Hi there! How can I help?","matchType":"EXACT","triggerType":"ALL","isMedia":false}'

[DELETE] /autoreplies/{sessionId}/{replyId}

Delete auto-reply rule

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
replyIdpathāœ… Yesstring—

Responses

CodeDescription
200Rule deleted
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Rule not found

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/autoreplies/session-01/reply_01" \ -H "X-API-Key: your-api-key"

[PUT] /autoreplies/{sessionId}/{replyId}

Update auto-reply rule

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
replyIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
keywordstringāœ… Yes—
responsestringāœ… Yes—
isMediabooleanNo—
mediaUrlstringNo—
triggerTypestringNoOptions: ALL, GROUP, PRIVATE

Example:

json
{ "keyword": "hello", "response": "Hi there! How can I help?", "matchType": "EXACT", "triggerType": "ALL", "isMedia": false }

Responses

CodeDescription
200Rule updated
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Rule not found

cURL Example

bash
curl -X PUT "http://localhost:3000/api/autoreplies/session-01/reply_01" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"keyword":"hello","response":"Hi there! How can I help?","matchType":"EXACT","triggerType":"ALL","isMedia":false}'

šŸ“‚ Scheduler

[DELETE] /scheduler/{sessionId}

Delete all scheduled messages for a session

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200Scheduled messages deleted

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/scheduler/session-01" \ -H "X-API-Key: your-api-key"

[GET] /scheduler/{sessionId}

List scheduled messages

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200List of scheduled messages
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Session not found

cURL Example

bash
curl -X GET "http://localhost:3000/api/scheduler/session-01" \ -H "X-API-Key: your-api-key"

[POST] /scheduler/{sessionId}

Create scheduled message

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
jidstringāœ… Yes—
contentstringāœ… Yes—
sendAtstring (date-time)āœ… Yes—
mediaUrlstringNo—
mediaTypestringNoOptions: image, video, document

Example:

json
{ "jid": "628123456789@s.whatsapp.net", "content": "Reminder: Meeting in 10 mins", "sendAt": "2024-12-25T10:00:00.000Z", "mediaUrl": "https://example.com/image.jpg", "mediaType": "image" }

Responses

CodeDescription
200Scheduled message created
400Missing required fields
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied

cURL Example

bash
curl -X POST "http://localhost:3000/api/scheduler/session-01" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"jid":"628123456789@s.whatsapp.net","content":"Reminder: Meeting in 10 mins","sendAt":"2024-12-25T10:00:00.000Z","mediaUrl":"https://example.com/image.jpg","mediaType":"image"}'

[DELETE] /scheduler/{sessionId}/{scheduleId}

Delete scheduled message

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
scheduleIdpathāœ… Yesstring—

Responses

CodeDescription
200Message deleted
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Message not found

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/scheduler/session-01/sched_01" \ -H "X-API-Key: your-api-key"

[PUT] /scheduler/{sessionId}/{scheduleId}

Update scheduled message

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
scheduleIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
jidstringāœ… Yes—
contentstringāœ… Yes—
sendAtstring (date-time)āœ… Yes—
mediaUrlstringNo—
mediaTypestringNoOptions: image, video, document

Example:

json
{ "jid": "628123456789@s.whatsapp.net", "content": "Updated meeting reminder", "sendAt": "2024-12-25T11:00:00.000Z", "mediaUrl": "https://example.com/image.jpg", "mediaType": "image" }

Responses

CodeDescription
200Message updated
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Message not found

cURL Example

bash
curl -X PUT "http://localhost:3000/api/scheduler/session-01/sched_01" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"jid":"628123456789@s.whatsapp.net","content":"Updated meeting reminder","sendAt":"2024-12-25T11:00:00.000Z","mediaUrl":"https://example.com/image.jpg","mediaType":"image"}'

[POST] /scheduler

Create a scheduled message task

Responses

CodeDescription
200Scheduled task created

cURL Example

bash
curl -X POST "http://localhost:3000/api/scheduler" \ -H "X-API-Key: your-api-key"

šŸ“‚ Webhooks

[GET] /webhooks/{sessionId}

List webhooks for a session

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200List of webhooks
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied

cURL Example

bash
curl -X GET "http://localhost:3000/api/webhooks/session-01" \ -H "X-API-Key: your-api-key"

[POST] /webhooks/{sessionId}

Create a webhook

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
namestringāœ… Yes—
urlstringāœ… Yes—
secretstringNo—
eventsarray of stringāœ… Yes—

Example:

json
{ "name": "string", "url": "string", "secret": "string", "events": [ "string" ] }

Responses

CodeDescription
200Webhook created
400Invalid input
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied

cURL Example

bash
curl -X POST "http://localhost:3000/api/webhooks/session-01" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"name":"string","url":"string","secret":"string","events":["string"]}'

[DELETE] /webhooks/{sessionId}/{id}

Delete webhook

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
idpathāœ… Yesstring—

Responses

CodeDescription
200Webhook deleted
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Webhook not found

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/webhooks/session-01/abc123" \ -H "X-API-Key: your-api-key"

[PUT] /webhooks/{sessionId}/{id}

Update webhook

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
idpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
namestringNo—
urlstringNo—
secretstringNo—
eventsarray of stringNo—
isActivebooleanNo—

Example:

json
{ "name": "string", "url": "string", "secret": "string", "events": [ "string" ], "isActive": true }

Responses

CodeDescription
200Webhook updated
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Webhook not found

cURL Example

bash
curl -X PUT "http://localhost:3000/api/webhooks/session-01/abc123" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"name":"string","url":"string","secret":"string","events":["string"],"isActive":true}'

[DELETE] /webhooks/{id}

Delete webhook

Parameters

NameLocated inRequiredTypeDescription
idpathāœ… Yesstring—

Responses

CodeDescription
200Webhook deleted
401Unauthorized - Invalid or missing API key
404Webhook not found
500Internal Server Error

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—

Response Example ( 200):

json
{ "success": true }

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/webhooks/abc123" \ -H "X-API-Key: your-api-key"

šŸ“‚ Users

[POST] /users

Create user (SUPERADMIN only)

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
namestringāœ… Yes—
emailstring (email)āœ… Yes—
passwordstringāœ… Yes—
rolestringNoOptions: SUPERADMIN, OWNER, STAFF Default: OWNER

Example:

json
{ "name": "string", "email": "string", "password": "string", "role": "SUPERADMIN" }

Responses

CodeDescription
200User created
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Internal Server Error

Response Fields ( 200):

FieldTypeRequiredDescription
idstringNo—
namestringNo—
emailstringNo—
rolestringNo—
createdAtstring (date-time)No—

Response Example ( 200):

json
{ "id": "string", "name": "string", "email": "string", "role": "string", "createdAt": "2026-01-15T08:00:00.000Z" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/users" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"name":"string","email":"string","password":"string","role":"SUPERADMIN"}'

[GET] /users

List users (SUPERADMIN only)

Responses

CodeDescription
200List of users
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Internal Server Error

Response Example ( 200):

json
[ { "id": "string", "name": "string", "email": "string", "role": "string", "createdAt": "2026-01-15T08:00:00.000Z", "_count": { "sessions": 0 } } ]

cURL Example

bash
curl -X GET "http://localhost:3000/api/users" \ -H "X-API-Key: your-api-key"

[DELETE] /users/{id}

Delete user (SUPERADMIN only)

Parameters

NameLocated inRequiredTypeDescription
idpathāœ… Yesstring—

Responses

CodeDescription
200User deleted
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404User not found
500Internal Server Error

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "string" }

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/users/abc123" \ -H "X-API-Key: your-api-key"

[PATCH] /users/{id}

Update user (SUPERADMIN only)

Parameters

NameLocated inRequiredTypeDescription
idpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
namestringNo—
emailstringNo—
passwordstringNo—
rolestringNoOptions: SUPERADMIN, OWNER, STAFF

Example:

json
{ "name": "string", "email": "string", "password": "string", "role": "SUPERADMIN" }

Responses

CodeDescription
200User updated
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404User not found
500Internal Server Error

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
userobjectNo—

Response Example ( 200):

json
{ "success": true, "user": { "id": "string", "email": "string", "name": "string", "role": "string", "emailVerified": "string", "image": "string", "createdAt": "2026-01-15T08:00:00.000Z", "updatedAt": "2026-01-15T08:00:00.000Z" } }

cURL Example

bash
curl -X PATCH "http://localhost:3000/api/users/abc123" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"name":"string","email":"string","password":"string","role":"SUPERADMIN"}'

[POST] /user/api-key

Generate new API key

Responses

CodeDescription
200New API key generated
401Unauthorized - Invalid or missing API key
500Failed to generate API key

Response Fields ( 200):

FieldTypeRequiredDescription
apiKeystringNo—

Response Example ( 200):

json
{ "apiKey": "string" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/user/api-key" \ -H "X-API-Key: your-api-key"

[DELETE] /user/api-key

Revoke API key

Responses

CodeDescription
200API key revoked
401Unauthorized - Invalid or missing API key
500Failed to revoke API key

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/user/api-key" \ -H "X-API-Key: your-api-key"

[GET] /user/api-key

Get current API key

Responses

CodeDescription
200Current API key
401Unauthorized - Invalid or missing API key

Response Fields ( 200):

FieldTypeRequiredDescription
apiKeystring, nullableNo—

Response Example ( 200):

json
{ "apiKey": "string" }

cURL Example

bash
curl -X GET "http://localhost:3000/api/user/api-key" \ -H "X-API-Key: your-api-key"

šŸ“‚ Labels

[POST] /labels/{sessionId}

Create label

Create new label with color (0-19 index)

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
namestringāœ… Yes—
colorintegerNoColor index (0-19)

Example:

json
{ "name": "Important", "color": 0 }

Responses

CodeDescription
200Label created
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to create label

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
labelobjectNo—

Response Example ( 200):

json
{ "success": true, "label": { "id": "string", "name": "string", "color": 0, "predefinedId": "string" } }

cURL Example

bash
curl -X POST "http://localhost:3000/api/labels/session-01" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"name":"Important","color":0}'

[PUT] /labels/{sessionId}

Update all labels or bulk update

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200Labels updated

cURL Example

bash
curl -X PUT "http://localhost:3000/api/labels/session-01" \ -H "X-API-Key: your-api-key"

[DELETE] /labels/{sessionId}

Delete labels

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200Labels deleted

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/labels/session-01" \ -H "X-API-Key: your-api-key"

[GET] /labels/{sessionId}

List labels

Get all labels with chat count

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Responses

CodeDescription
200List of labels
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Session not found

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
labelsarray of objectNo—

Response Example ( 200):

json
{ "success": true, "labels": [ { "id": "string", "name": "string", "color": 0, "predefinedId": "string" } ] }

cURL Example

bash
curl -X GET "http://localhost:3000/api/labels/session-01" \ -H "X-API-Key: your-api-key"

[DELETE] /labels/{sessionId}/{labelId}

Delete label

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
labelIdpathāœ… Yesstring—

Responses

CodeDescription
200Label deleted

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/labels/session-01/label_01" \ -H "X-API-Key: your-api-key"

[PUT] /labels/{sessionId}/{labelId}

Update label

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
labelIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
namestringNo—
colorintegerNo—

Example:

json
{ "name": "string", "color": 0 }

Responses

CodeDescription
200Label updated

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
labelobjectNo—

Response Example ( 200):

json
{ "success": true, "label": { "id": "string", "name": "string", "color": 0, "predefinedId": "string" } }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/labels/session-01/label_01" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"name":"string","color":0}'

[GET] /labels/{sessionId}/chat/{jid}/labels

Get chat labels

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Responses

CodeDescription
200Chat labels

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
labelsarray of objectNo—

Response Example ( 200):

json
{ "success": true, "labels": [ { "id": "string", "name": "string", "color": 0, "predefinedId": "string" } ] }

cURL Example

bash
curl -X GET "http://localhost:3000/api/labels/session-01/chat/628123456789@s.whatsapp.net/labels" \ -H "X-API-Key: your-api-key"

[PUT] /labels/{sessionId}/chat/{jid}/labels

Update chat labels

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
labelIdsarray of stringāœ… Yes—
actionstringāœ… YesOptions: add, remove

Example:

json
{ "labelIds": [ "string" ], "action": "add" }

Responses

CodeDescription
200Chat labels updated

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—
labelsarray of objectNo—

Response Example ( 200):

json
{ "success": true, "message": "string", "labels": [ { "id": "string", "name": "string", "color": 0, "predefinedId": "string" } ] }

cURL Example

bash
curl -X PUT "http://localhost:3000/api/labels/session-01/chat/628123456789@s.whatsapp.net/labels" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"labelIds":["string"],"action":"add"}'

[GET] /chats/{sessionId}/by-label/{labelId}

Get chats by label

Get all chats associated with a specific label

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
labelIdpathāœ… Yesstring—

Responses

CodeDescription
200List of chats with label
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Label not found

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
labelobjectNo—
chatsarray of stringNo—
countintegerNo—

Response Example ( 200):

json
{ "success": true, "label": { "text": "Hello from WhatsApp CRM!" }, "chats": [ "string" ], "count": 0 }

cURL Example

bash
curl -X GET "http://localhost:3000/api/chats/session-01/by-label/label_01" \ -H "X-API-Key: your-api-key"

šŸ“‚ Notifications

[POST] /notifications

Create notification

Send a notification to a specific user or broadcast to all (Superadmin only)

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
titlestringāœ… Yes—
messagestringāœ… Yes—
typestringNoOptions: INFO, SUCCESS, WARNING, ERROR Default: INFO
hrefstringNo—
targetUserIdstringNoTarget user UUID
broadcastbooleanNoDefault: false

Example:

json
{ "title": "Maintenance", "message": "System update in 5 minutes", "type": "INFO", "href": "/settings", "targetUserId": "string", "broadcast": true }

Responses

CodeDescription
200Notification created
400Invalid request
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Error creating notification

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
countintegerNoNumber of users notified if broadcast

Response Example ( 200):

json
{ "success": true, "count": 0 }

cURL Example

bash
curl -X POST "http://localhost:3000/api/notifications" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"title":"Maintenance","message":"System update in 5 minutes","type":"INFO","href":"/settings","targetUserId":"string","broadcast":true}'

[GET] /notifications

List notifications

Get the last 50 notifications for the authenticated user

Responses

CodeDescription
200List of notifications
401Unauthorized - Invalid or missing API key
500Error fetching notifications

Response Example ( 200):

json
[ { "id": "string", "userId": "string", "title": "string", "message": "string", "type": "string", "href": "string", "read": true, "createdAt": "2026-01-15T08:00:00.000Z" } ]

cURL Example

bash
curl -X GET "http://localhost:3000/api/notifications" \ -H "X-API-Key: your-api-key"

[PATCH] /notifications/read

Mark notifications as read

Mark specific or all notifications as read for the authenticated user

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
idsarray of stringNoArray of notification IDs. If omitted or empty, all notifications are marked as read.

Example:

json
{ "ids": [ "string" ] }

Responses

CodeDescription
200Notifications updated
401Unauthorized - Invalid or missing API key
500Error updating notifications

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X PATCH "http://localhost:3000/api/notifications/read" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"ids":["string"]}'

[DELETE] /notifications/delete

Delete specific notification

Parameters

NameLocated inRequiredTypeDescription
idqueryāœ… YesstringNotification UUID

Responses

CodeDescription
200Notification deleted
400Notification ID required
401Unauthorized - Invalid or missing API key
500Error deleting notification

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X DELETE "http://localhost:3000/api/notifications/delete?id=abc123" \ -H "X-API-Key: your-api-key"

šŸ“‚ System

[POST] /settings/system

Update system settings

Update global system configuration (Superadmin/Owner only)

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
appNamestringNo—
logoUrlstringNo—
timezonestringNo—

Example:

json
{ "appName": "string", "logoUrl": "string", "timezone": "string" }

Responses

CodeDescription
200Settings updated
401Unauthorized - Invalid or missing API key
500Failed to update settings

Response Fields ( 200):

FieldTypeRequiredDescription
idstringNo—
appNamestringNo—
logoUrlstringNo—
timezonestringNo—
updatedAtstring (date-time)No—

Response Example ( 200):

json
{ "id": "string", "appName": "string", "logoUrl": "string", "timezone": "string", "updatedAt": "2026-01-15T08:00:00.000Z" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/settings/system" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"appName":"string","logoUrl":"string","timezone":"string"}'

[GET] /settings/system

Get system settings

Responses

CodeDescription
200System settings

Response Fields ( 200):

FieldTypeRequiredDescription
idstringNo—
appNamestringNo—
logoUrlstringNo—
timezonestringNo—

Response Example ( 200):

json
{ "id": "default", "appName": "WhatsApp CRM", "logoUrl": "https://example.com/logo.png", "timezone": "Asia/Jakarta" }

cURL Example

bash
curl -X GET "http://localhost:3000/api/settings/system" \ -H "X-API-Key: your-api-key"

[POST] /status/{sessionId}/update

Update status

Post a status update (story) to WhatsApp. Supports text, image, and video.

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
contentstringāœ… YesStatus text or caption
typestringNoOptions: TEXT, IMAGE, VIDEO Default: TEXT
mediaUrlstringNoRequired for IMAGE and VIDEO
backgroundColorintegerNo—
fontintegerNo—
mentionsarray of stringNo—

Example:

json
{ "content": "string", "type": "TEXT", "mediaUrl": "string", "backgroundColor": 0, "font": 0, "mentions": [ "string" ] }

Responses

CodeDescription
200Status posted
400Missing required fields
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
503Session not connected or ready

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X POST "http://localhost:3000/api/status/session-01/update" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"content":"string","type":"TEXT","mediaUrl":"string","backgroundColor":0,"font":0,"mentions":["string"]}'

[POST] /status/update

Update status

Post a status update (story) to WhatsApp. Supports text, image, and video.

Headers

 X-API-Key: your-api-key
Content-Type: application/json

Request Body ( application/json)

FieldTypeRequiredDescription
sessionIdstringāœ… Yes—
contentstringāœ… YesStatus text or caption
typestringNoOptions: TEXT, IMAGE, VIDEO Default: TEXT
mediaUrlstringNoRequired for IMAGE and VIDEO
backgroundColorintegerNoARGB color for TEXT status
fontintegerNoFont style for TEXT status
mentionsarray of stringNoList of JIDs to mention/tag in the status

Example:

json
{ "sessionId": "string", "content": "string", "type": "TEXT", "mediaUrl": "string", "backgroundColor": 0, "font": 0, "mentions": [ "string" ] }

Responses

CodeDescription
200Status updated
400Missing required fields
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to post status
503Session not ready

Response Fields ( 200):

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Response Example ( 200):

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

cURL Example

bash
curl -X POST "http://localhost:3000/api/status/update" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"sessionId":"string","content":"string","type":"TEXT","mediaUrl":"string","backgroundColor":0,"font":0,"mentions":["string"]}'

[POST] /system/check-updates

Check for updates

Checks for new releases on GitHub and creates a system notification if a newer version is available.

Responses

CodeDescription
200Check results
401Unauthorized - Invalid or missing API key
500Error checking updates

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—
versionstringNoLatest version tag

Response Example ( 200):

json
{ "success": true, "message": "string", "version": "string" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/system/check-updates" \ -H "X-API-Key: your-api-key"

šŸ“‚ Contacts

[POST] /contacts/{sessionId}/{jid}/block

Block contact

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Responses

CodeDescription
200Contact blocked
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to block contact

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "string" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/contacts/session-01/628123456789@s.whatsapp.net/block" \ -H "X-API-Key: your-api-key"

[POST] /contacts/{sessionId}/{jid}/unblock

Unblock contact

Parameters

NameLocated inRequiredTypeDescription
sessionIdpathāœ… Yesstring—
jidpathāœ… Yesstring—

Responses

CodeDescription
200Contact unblocked
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
500Failed to unblock contact

Response Fields ( 200):

FieldTypeRequiredDescription
successbooleanNo—
messagestringNo—

Response Example ( 200):

json
{ "success": true, "message": "string" }

cURL Example

bash
curl -X POST "http://localhost:3000/api/contacts/session-01/628123456789@s.whatsapp.net/unblock" \ -H "X-API-Key: your-api-key"

šŸ“¦ Schemas

Error

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
errorstringNo—

Example:

json
{ "status": false, "message": "Error occurred", "error": "Detailed error info" }

Success

FieldTypeRequiredDescription
statusbooleanNo—
messagestringNo—
dataobject, nullableNo—

Example:

json
{ "status": true, "message": "Operation successful", "data": { "text": "Hello from WhatsApp CRM!" } }

Session

FieldTypeRequiredDescription
idstringNo—
namestringNo—
sessionIdstringNo—
statusstringNoOptions: Connected, Disconnected, Connecting
userIdstringNo—
botConfigobject, nullableNo—
webhooksarray of objectNo—
_countobject, nullableNo—
createdAtstring (date-time)No—
updatedAtstring (date-time)No—

Example:

json
{ "id": "clx123abc", "name": "Marketing Bot", "sessionId": "marketing-1", "status": "Connected", "userId": "string", "botConfig": { "text": "Hello from WhatsApp CRM!" }, "webhooks": [ { "text": "Hello from WhatsApp CRM!" } ], "_count": { "contacts": 0, "messages": 0, "groups": 0, "autoReplies": 0, "scheduledMessages": 0 }, "createdAt": "2026-01-15T08:00:00.000Z", "updatedAt": "2026-01-15T08:00:00.000Z" }

Message

FieldTypeRequiredDescription
textstringNo—

Example:

json
{ "text": "Hello! How can I help you?" }

Contact

FieldTypeRequiredDescription
jidstringNo—
namestringNo—
notifystringNo—
profilePicstring, nullableNo—

Example:

json
{ "jid": "628123456789@s.whatsapp.net", "name": "John Doe", "notify": "string", "profilePic": "string" }

ScheduledMessage

FieldTypeRequiredDescription
idstringNo—
sessionIdstringNo—
jidstringNo—
contentstringNo—
sendAtstring (date-time)No—
statusstringNo—

Example:

json
{ "id": "string", "sessionId": "string", "jid": "string", "content": "string", "sendAt": "2026-01-15T08:00:00.000Z", "status": "PENDING" }

Webhook

FieldTypeRequiredDescription
idstringNo—
sessionIdstringNo—
urlstringNo—
eventsarray of stringNoEvents to subscribe to: message.received, message.sent, message.status, connection.update, group.update, contact.update, status.update, group.participant, message.deleted, message.edited or '*'
secretstringNo—

Example:

json
{ "id": "string", "sessionId": "string", "url": "string", "events": [ "string" ], "secret": "string" }

Group

FieldTypeRequiredDescription
idstringNo—
subjectstringNo—
descstringNo—
ownerstringNo—
sizenumberNo—
isCommunitybooleanNoWhether this group is a WhatsApp Community announcement group
linkedParentJidstring, nullableNoJID of the parent community if this is a sub-group
participantsarray of objectNo—

Example:

json
{ "id": "string", "subject": "string", "desc": "string", "owner": "string", "size": 0, "isCommunity": true, "linkedParentJid": "string", "participants": [ { "id": "string", "admin": "string" } ] }

Label

FieldTypeRequiredDescription
idstringNo—
namestringNo—
colornumber, nullableNo—
predefinedIdstring, nullableNo—

Example:

json
{ "id": "string", "name": "string", "color": 0, "predefinedId": "string" }

GroupDetails

FieldTypeRequiredDescription
idstringNo—
subjectstringNo—
subjectOwnerstringNo—
subjectTimenumberNo—
descstringNo—
descOwnerstringNo—
descIdstringNo—
ownerstringNo—

Example:

json
{ "id": "string", "subject": "string", "subjectOwner": "string", "subjectTime": 0, "desc": "string", "descOwner": "string", "descId": "string", "owner": "string" }