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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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
[]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.