MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

This API is not authenticated.

Endpoints

Create a new WhatsApp session

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/whatsapp/sessions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"session_name\": \"vmqeopfuudtdsufvyvddq\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/whatsapp/sessions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "session_name": "vmqeopfuudtdsufvyvddq"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/whatsapp/sessions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

session_name   string   

Must not be greater than 255 characters. Example: vmqeopfuudtdsufvyvddq

Get the status of a session

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur/status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur/status"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthorized - No Bearer Token"
}
 

Request      

GET api/whatsapp/sessions/{sessionId}/status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sessionId   string   

Example: consequatur

Get the status active from session device id

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthorized - No Bearer Token"
}
 

Request      

GET api/whatsapp/sessions/{deviceId}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

deviceId   string   

Example: consequatur

Disconnect a session

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur/disconnect" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur/disconnect"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/whatsapp/sessions/{sessionId}/disconnect

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sessionId   string   

Example: consequatur

Delete a session

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/whatsapp/sessions/{sessionId}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sessionId   string   

Example: consequatur

Delete a session

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur/device" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur/device"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/whatsapp/sessions/{sessionId}/device

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sessionId   string   

Example: consequatur

Send a text message

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/whatsapp/messages/text" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"session_id\": \"consequatur\",
    \"to\": \"consequatur\",
    \"message\": \"consequatur\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/whatsapp/messages/text"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "session_id": "consequatur",
    "to": "consequatur",
    "message": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/whatsapp/messages/text

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

session_id   string   

Example: consequatur

to   string   

Example: consequatur

message   string   

Example: consequatur

Send Media (image, audio, vidéo, document)

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/whatsapp/messages/media" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"session_id\": \"consequatur\",
    \"to\": \"consequatur\",
    \"media_url\": \"https:\\/\\/www.mueller.com\\/laborum-eius-est-dolor-dolores-minus-voluptatem\",
    \"type\": \"document\",
    \"caption\": \"consequatur\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/whatsapp/messages/media"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "session_id": "consequatur",
    "to": "consequatur",
    "media_url": "https:\/\/www.mueller.com\/laborum-eius-est-dolor-dolores-minus-voluptatem",
    "type": "document",
    "caption": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/whatsapp/messages/media

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

session_id   string   

Example: consequatur

to   string   

Example: consequatur

media_url   string   

Must be a valid URL. Example: https://www.mueller.com/laborum-eius-est-dolor-dolores-minus-voluptatem

type   string   

Example: document

Must be one of:
  • image
  • audio
  • video
  • document
caption   string  optional  

Example: consequatur

Get message history

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur/messages" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur/messages"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthorized - No Bearer Token"
}
 

Request      

GET api/whatsapp/sessions/{sessionId}/messages

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sessionId   string   

Example: consequatur

Get contacts for a session

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur/contacts" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/whatsapp/sessions/consequatur/contacts"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthorized - No Bearer Token"
}
 

Request      

GET api/whatsapp/sessions/{sessionId}/contacts

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sessionId   string   

Example: consequatur

GET api/health

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/health" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/health"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "status": "OK",
    "timestamp": "2025-08-19T11:46:21.638578Z",
    "service": "WhatsApp Baileys API"
}
 

Request      

GET api/health

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/test-node-connection

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/test-node-connection" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/test-node-connection"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "success": false,
    "message": "Connection error: cURL error 7: Failed to connect to localhost port 5000 after 2237 ms: Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:5000/health"
}
 

Request      

GET api/test-node-connection

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/api-tokens

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/api-tokens" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": \"66529e01-d113-3473-8d6f-9e11e09332ea\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/api-tokens"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "user_id": "66529e01-d113-3473-8d6f-9e11e09332ea"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

[]
 

Request      

GET api/api-tokens

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

user_id   string   

Must be a valid UUID. Example: 66529e01-d113-3473-8d6f-9e11e09332ea

POST api/api-tokens/generate

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/api-tokens/generate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"vmqeopfuudtdsufvyvddq\",
    \"user_id\": \"462ee709-6d9f-345a-95e6-76f833111fb8\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/api-tokens/generate"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "vmqeopfuudtdsufvyvddq",
    "user_id": "462ee709-6d9f-345a-95e6-76f833111fb8"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/api-tokens/generate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must not be greater than 255 characters. Example: vmqeopfuudtdsufvyvddq

user_id   string   

Must be a valid UUID. Example: 462ee709-6d9f-345a-95e6-76f833111fb8

DELETE api/api-tokens

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/api-tokens" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": \"66529e01-d113-3473-8d6f-9e11e09332ea\",
    \"id\": \"consequatur\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/api-tokens"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "user_id": "66529e01-d113-3473-8d6f-9e11e09332ea",
    "id": "consequatur"
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

DELETE api/api-tokens

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

user_id   string   

Must be a valid UUID. Example: 66529e01-d113-3473-8d6f-9e11e09332ea

id   string   

Example: consequatur