API Documentation • Self-hosted WhatsApp API • Built on waha.devlike.pro
Last updated: September 8th, 2025
Complete reference for integrating Sunsal Wapim WhatsApp API into your applications. Manage sessions, send messages, and automate WhatsApp communications.
All API requests require authentication using X-Session-Id & X-Session-Secret-Token. Include your token in the header:
X-Session-Id: {{ SESSION_ID }}
X-Session-Secret-Token: {{ SESSION_SECRET_TOKEN }}
{{ API_URL }}
application/json
/devices
Fetch a list of all devices registered in the system. Useful for dashboards or monitoring multiple WhatsApp devices.
{
"status": true,
"message": "",
"data": {
"list": [
{
"id": 1,
"name": "WAPI Test",
"session_id": "wapi-test",
"phone_number": "62811010010010",
"status": "scan_qr_code",
"secret_token": "9f13a714ce15ddeb1e02835772b53fcc5de6355f05204354bbbc0023601816ee",
"webhook_status": 1,
"webhook_url": "https://f947f32ac09a.ngrok-free.app/api/v1/waha-webhook",
"webhook_options": "[\"message\",\"message.ack\",\"message.waiting\"]",
"opening_message": "Hello",
"closing_message": "Hola",
"auto_reply": "Hai",
"auto_forward": "Hei",
"auto_forward_number": "62811010010010"
}
],
"meta": {
"links": [
"http://127.0.0.1:8000/api/devices?sort=id%20DESC&page=1"
],
"total": 1
}
}
}
/devices/:id
Retrieve complete information about a single device by ID. Returns metadata such as device name, status, and linked account.
{
"status": true,
"message": "",
"data": {
"id": 1,
"name": "WAPI Test",
"session_id": "wapi-test",
"phone_number": "62811010010010",
"status": "scan_qr_code",
"secret_token": "9f13a714ce15ddeb1e02835772b53fcc5de6355f05204354bbbc0023601816ee",
"webhook_status": 1,
"webhook_url": "https://f947f32ac09a.ngrok-free.app/api/v1/waha-webhook",
"webhook_options": "[\"message\",\"message.ack\",\"message.waiting\"]",
"opening_message": "Hello",
"closing_message": "Hola",
"auto_reply": "Hai",
"auto_forward": "Hei",
"auto_forward_number": "62811010010010"
}
}
/devices
Add a new device entry into the system. Often used when setting up a new WhatsApp client.
{
"name": "WAPI Test",
"phone_number": "0811010010010",
"secret_token": "9f13a714ce15ddeb1e02835772b53fcc5de6355f05204354bbbc0023601816ee",
"webhook_status": true,
"webhook_url": "https://f947f32ac09a.ngrok-free.app/api/v1/waha-webhook",
"webhook_options": [
"message",
"message.ack",
"message.waiting"
],
"opening_message": "Hello",
"closing_message": "Hola",
"auto_reply": "Hai",
"auto_forward": "Hei",
"auto_forward_number": "811010010010"
}
{
"status": true,
"message": "Data successfully added",
"data": {
"id": 1,
"name": "WAPI Test",
"session_id": "wapi-test",
"phone_number": "62811010010010",
"status": "scan_qr_code",
"secret_token": "9f13a714ce15ddeb1e02835772b53fcc5de6355f05204354bbbc0023601816ee",
"webhook_status": true,
"webhook_url": "https://f947f32ac09a.ngrok-free.app/api/v1/waha-webhook",
"webhook_options": "[\"message\",\"message.ack\",\"message.waiting\"]",
"opening_message": "Hello",
"closing_message": "Hola",
"auto_reply": "Hai",
"auto_forward": "Hei",
"auto_forward_number": "62811010010010"
}
}
/devices/:id
Modify device details (name, configuration, webhook URL, etc.).
{
"name": "WAPI Test",
"phone_number": "0811010010010",
"secret_token": "9f13a714ce15ddeb1e02835772b53fcc5de6355f05204354bbbc0023601816ee",
"webhook_status": true,
"webhook_url": "https://f947f32ac09a.ngrok-free.app/api/v1/waha-webhook",
"webhook_options": [
"message",
"message.ack",
"message.waiting"
],
"opening_message": "Hello",
"closing_message": "Hola",
"auto_reply": "Hai",
"auto_forward": "Hei",
"auto_forward_number": "811010010010"
}
{
"status": true,
"message": "Data successfully modified",
"data": {
"id": 1,
"name": "WAPI Test",
"session_id": "wapi-test",
"phone_number": "62811010010010",
"status": "scan_qr_code",
"secret_token": "9f13a714ce15ddeb1e02835772b53fcc5de6355f05204354bbbc0023601816ee",
"webhook_status": 1,
"webhook_url": "https://f947f32ac09a.ngrok-free.app/api/v1/waha-webhook",
"webhook_options": "[\"message\",\"message.ack\",\"message.waiting\"]",
"opening_message": "Hello",
"closing_message": "Hola",
"auto_reply": "Hai",
"auto_forward": "Hei",
"auto_forward_number": "62811010010010"
}
}
/devices/:id
Soft-delete a device. It will not be permanently erased, and can be restored later if needed.
{
"status": true,
"message": "Data successfully deleted",
"data": {
"id": 1,
"name": "WAPI Test",
"session_id": "wapi-test",
"phone_number": "62811010010010",
"status": "scan_qr_code",
"secret_token": "9f13a714ce15ddeb1e02835772b53fcc5de6355f05204354bbbc0023601816ee",
"webhook_status": 1,
"webhook_url": "https://f947f32ac09a.ngrok-free.app/api/v1/waha-webhook",
"webhook_options": "[\"message\",\"message.ack\",\"message.waiting\"]",
"opening_message": "Hello",
"closing_message": "Hola",
"auto_reply": "Hai",
"auto_forward": "Hei",
"auto_forward_number": "62811010010010"
}
}
/devices/:id/restore
Restore a previously deleted device back to active state. Useful for accidental deletions or temporary suspensions.
{
"status": true,
"message": "Data successfully restored",
"data": {
"id": 1,
"name": "WAPI Test",
"session_id": "wapi-test",
"phone_number": "62811010010010",
"status": "scan_qr_code",
"secret_token": "9f13a714ce15ddeb1e02835772b53fcc5de6355f05204354bbbc0023601816ee",
"webhook_status": 1,
"webhook_url": "https://f947f32ac09a.ngrok-free.app/api/v1/waha-webhook",
"webhook_options": "[\"message\",\"message.ack\",\"message.waiting\"]",
"opening_message": "Hello",
"closing_message": "Hola",
"auto_reply": "Hai",
"auto_forward": "Hei",
"auto_forward_number": "62811010010010"
}
}
/messages
Retrieve all messages stored in the system. Useful for logs, audit trails, or message dashboards.
{
"status": true,
"message": "",
"data": {
"list": [
{
"id": 1,
"device_id": 1,
"session_id": "wapi-test",
"is_queue": 1,
"recipient": "62811010010010",
"message_type": "text",
"message": "Welcome home",
"file_mimetype": null,
"file_filename": null,
"file_url": null,
"calendar_type": "masehi",
"schedule_at": "2025-09-08T02:44:00.000000Z",
"status": "pending",
"is_sent": 0,
"provider_message_id": null,
"api_response": null,
"sent_at": null,
"delivered_at": null,
"read_at": null,
"status_updated_at": null
}
],
"meta": {
"links": [
"http://127.0.0.1:8000/api/messages?sort=id%20DESC&page=1"
],
"total": 1
}
}
}
/messages/:id
Fetch complete details of a specific message, including content, status, and recipient info.
{
"status": true,
"message": "",
"data": {
"id": 1,
"device_id": 1,
"session_id": "wapi-test",
"is_queue": 1,
"recipient": "62811010010010",
"message_type": "text",
"message": "Welcome home",
"file_mimetype": null,
"file_filename": null,
"file_url": null,
"calendar_type": "masehi",
"schedule_at": "2025-09-08T02:44:00.000000Z",
"status": "pending",
"is_sent": 0,
"provider_message_id": null,
"api_response": null,
"sent_at": null,
"delivered_at": null,
"read_at": null,
"status_updated_at": null
}
}
/messages
Store a new message record. Typically used before sending or for internal logging.
{
"session_id": "SESSION_ID",
"is_queue": true,
"recipient": "0811010010010",
"message_type": "text",
"message": "Welcome home",
"file_url": "https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg",
"schedule_at": "2025-09-08 09:44:00"
}
{
"status": true,
"message": "Data successfully added",
"data": {
"id": 1,
"device_id": 1,
"session_id": "wapi-test",
"is_queue": true,
"recipient": "62811010010010",
"message_type": "text",
"message": "Welcome home",
"file_mimetype": null,
"file_filename": null,
"file_url": null,
"calendar_type": null,
"schedule_at": "2025-09-08T02:44:00.000000Z",
"status": null,
"is_sent": null,
"provider_message_id": null,
"api_response": null,
"sent_at": null,
"delivered_at": null,
"read_at": null,
"status_updated_at": null
}
}
/messages-batch
Store multiple messages in a single request. Efficient for campaigns or bulk messaging where many recipients are targeted.
{
"items": [
{
"session_id": "SESSION_ID",
"is_queue": false,
"recipient": "62811010010010",
"message_type": "text",
"message": "Hai 1",
"schedule_at": "2025-09-08 09:51:00"
},
{
"session_id": "SESSION_ID",
"is_queue": true,
"recipient": "62811010010010",
"message_type": "image",
"message": "Cek gambar",
"file_url": "https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg",
"schedule_at": "2025-09-08 09:52:00"
},
{
"session_id": "SESSION_ID",
"is_queue": true,
"recipient": "62811010010010",
"message_type": "file",
"message": "PDF besok",
"file_url": "https://api.rucika.co.id/price-list/16/download",
"schedule_at": "2025-09-08 09:53:00"
}
]
}
{
"status": true,
"message": "Batch processed",
"data": {
"batch_id": "9fd352e1-a8bd-4bc7-a9cc-b9c9e1f47167",
"items": [
{
"index": 0,
"status": true,
"message_id": "4"
},
{
"index": 1,
"status": true,
"message_id": "5"
},
{
"index": 2,
"status": true,
"message_id": "6"
}
]
}
}
/messages/:id
Edit message details or status. For example, mark a message as “processed” or update metadata.
{
"session_id": "SESSION_ID",
"is_queue": false,
"recipient": "0811010010010",
"message_type": "text",
"message": "Hola",
"file_url": "https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg",
"schedule_at": "2025-09-08 10:00:00"
}
{
"status": true,
"message": "Data successfully modified",
"data": {
"id": 1,
"device_id": 1,
"session_id": "wapi-test",
"is_queue": 0,
"recipient": "62811010010010",
"message_type": "text",
"message": "Hola",
"file_mimetype": null,
"file_filename": null,
"file_url": null,
"calendar_type": "masehi",
"schedule_at": null,
"status": "sent",
"is_sent": 1,
"provider_message_id": "true_62811010010010@c.us_3EB0A5E42732E237A42D7F",
"api_response": null,
"sent_at": "2025-09-08T02:44:36.000000Z",
"delivered_at": null,
"read_at": null,
"status_updated_at": "2025-09-08T02:44:36.000000Z"
}
}
/messages/:id
Soft-delete a message. It remains in the system but inactive.
{
"status": true,
"message": "Data successfully deleted",
"data": {
"id": 1,
"device_id": 1,
"session_id": "wapi-test",
"is_queue": 0,
"recipient": "62811010010010",
"message_type": "text",
"message": "Hola",
"file_mimetype": null,
"file_filename": null,
"file_url": null,
"calendar_type": "masehi",
"schedule_at": null,
"status": "sent",
"is_sent": 1,
"provider_message_id": "true_62811010010010@c.us_3EB0A5E42732E237A42D7F",
"api_response": null,
"sent_at": "2025-09-08T02:44:36.000000Z",
"delivered_at": null,
"read_at": null,
"status_updated_at": "2025-09-08T02:44:36.000000Z"
}
}
/messages/:id/restore
Restore a previously deleted message back into active records.
{
"status": true,
"message": "Data successfully restored",
"data": {
"id": 1,
"device_id": 1,
"session_id": "wapi-test",
"is_queue": 0,
"recipient": "62811010010010",
"message_type": "text",
"message": "Hola",
"file_mimetype": null,
"file_filename": null,
"file_url": null,
"calendar_type": "masehi",
"schedule_at": null,
"status": "sent",
"is_sent": 1,
"provider_message_id": "true_62811010010010@c.us_3EB0A5E42732E237A42D7F",
"api_response": null,
"sent_at": "2025-09-08T02:44:36.000000Z",
"delivered_at": null,
"read_at": null,
"status_updated_at": "2025-09-08T02:44:36.000000Z"
}
}
/v1/waha/sessions/:session_id/me
Retrieve details about the current authenticated WhatsApp account. Often used to confirm the number and profile of the logged-in account.
{
"id": "62811010010010@c.us",
"pushName": "User Guest",
"jid": "62811010010010:89@s.whatsapp.net"
}
/v1/waha/:session_id/profile
Fetch the WhatsApp profile data of the connected session. Returns display name, profile picture, and other info.
{
"id": "62811010010010@c.us",
"name": "User Guest",
"picture": "https://pps.whatsapp.net/v/t61.24694-24/534423495_2212800639238447_2813432646728527521_n.jpg"
}
/v1/waha/sessions/:session_id/restart
Restart a session if it becomes disconnected or unstable. Useful for automatic recovery without creating a new session.
{
"name": "wapi-test",
"status": "STARTING",
"config": {
"metadata": {
"user.id": "1",
"user.email": "userguest@gmail.com"
},
"proxy": null,
"debug": false,
"noweb": {
"markOnline": true,
"store": {
"enabled": true,
"fullSync": false
}
},
"webhooks": [
{
"url": "https://f947f32ac09a.ngrok-free.app/api/v1/waha-webhook",
"events": [
"session.status",
"message.ack",
"message.waiting"
],
"hmac": null,
"retries": null,
"customHeaders": null
}
]
},
"engine": {
"grpc": {
"client": "READY",
"stream": "READY"
},
"gows": {
"found": true,
"connected": true
}
}
}
/v1/waha/sessions/:session_id/logout
Log out from the WhatsApp account but keep the session entry intact in the system.
{
"name": "wapi-test",
"status": "STARTING",
"config": {
"metadata": {
"user.id": "1",
"user.email": "userguest@gmail.com"
},
"proxy": null,
"debug": false,
"noweb": {
"markOnline": true,
"store": {
"enabled": true,
"fullSync": false
}
},
"webhooks": [
{
"url": "https://f947f32ac09a.ngrok-free.app/api/v1/waha-webhook",
"events": [
"session.status",
"message.ack",
"message.waiting"
],
"hmac": null,
"retries": null,
"customHeaders": null
}
]
},
"engine": {
"grpc": {
"client": "READY",
"stream": "READY"
},
"gows": {
"found": true,
"connected": true
}
}
}
/v1/waha/:session_id/auth/qr.png?format=image
Generate a QR code to be scanned in WhatsApp mobile app for creating or reconnecting a session.
/generate-token
Generate an authentication token (Session Secret Token) for secure API calls.
{
"secret_token": "9126751aaadb2fa796d969a41831ad9c1c36577e0d61572b89b75e5d64d75206"
}
/v1/waha/contacts/check-exists?phone=62895395151395&session=SESSION_ID
Validate whether a phone number is registered with WhatsApp. Prevents wasted API calls to numbers that don’t exist.
{
"numberExists": true,
"chatId": "62895395151395@c.us"
}