WhatsApp Business API
Wpbox API Reference
Integrate with WhatsApp Cloud API to send messages, manage contacts, run campaigns, and automate customer communication at scale.
Overview
The Wpbox API provides programmatic access to WhatsApp Business features. Built on top of the Meta WhatsApp Cloud API (v19.0), it enables you to send messages, manage contacts, create campaigns, and work with approved message templates.
Base URL
https://api.wacm.in/api/v1All endpoints require authentication via Bearer token or query parameter. The API supports both GET and POST methods for most endpoints for maximum compatibility.
Authentication
Use your Personal Access Token from the WACM dashboard (Settings → API) to authenticate requests.
curl -X GET "https://api.wacm.in/api/v1/contacts" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"Webhook Setup
Configure your WhatsApp webhook URL in the Meta Developer Console to receive incoming messages and status updates.
https://yourdomain.com/api/wpbox/{your_sanctum_token}The webhook accepts both GET (verification) and POST (message delivery) requests. Use a Laravel Sanctum personal access token for verification.
Webhook Payload - Incoming Message
{
"entry": [{
"id": "WABA_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"messages": [{
"from": "919876543210",
"id": "wamid.XXX",
"timestamp": "1234567890",
"type": "text",
"text": { "body": "Hello" }
}],
"contacts": [{
"profile": { "name": "John Doe" },
"wa_id": "919876543210"
}]
}
}]
}]
}Webhook Payload - Status Update
{
"entry": [{
"changes": [{
"value": {
"messaging_product": "whatsapp",
"statuses": [{
"id": "wamid.XXX",
"status": "delivered",
"timestamp": "1234567890",
"recipient_id": "919876543210"
}]
}
}]
}]
}Profile
/meGet authenticated user profile
{
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"company_id": 1,
"role": "owner"
}Contacts
/contactsList all contacts with pagination
/contactsCreate a new contact
/contacts/{id}Get contact details with groups and fields
/contacts/{id}Update contact information
/contacts/{id}/groups-and-fieldsGet contact groups and custom fields
/contacts/{id}/notesGet contact notes
/contacts/check-phoneCheck if phone number exists on WhatsApp
Create Contact
curl -X POST "https://api.wacm.in/api/v1/contacts" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"phone": "+919876543210",
"email": "john@example.com"
}'Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Contact full name |
| phone | string | Required | WhatsApp phone number with country code |
| string | Optional | Contact email address | |
| country_id | integer | Optional | Country ID reference |
| user_id | integer | Optional | Assigned agent/user ID |
Response
{
"id": 123,
"name": "John Doe",
"phone": "+919876543210",
"email": "john@example.com",
"avatar": null,
"enabled_ai_bot": true,
"subscribed": true,
"created_at": "2025-01-15T10:30:00.000000Z"
}Messages
/messages/textSend a text message
/messages/textSend a text message (GET)
/messages/templateSend an approved template message
/messages/templateSend template message (GET)
/messages/listSend an interactive list message
/messages/listSend list message (GET)
Send Text Message
curl -X POST "https://api.wacm.in/api/v1/messages/text" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "+919876543210",
"message": "Hello! This is a test message from WACM API."
}'Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | string | Required | Recipient WhatsApp number |
| message | string | Required | Message text content |
Send Template Message
curl -X POST "https://api.wacm.in/api/v1/messages/template" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "+919876543210",
"template_name": "order_confirmation",
"language": "en",
"variables": {
"1": "John Doe",
"2": "ORD-12345"
}
}'Send List Message
curl -X POST "https://api.wacm.in/api/v1/messages/list" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "+919876543210",
"header": "Choose an option",
"body": "Please select from the options below:",
"footer": "Powered by WACM",
"button_text": "View Options",
"sections": [
{
"title": "Main Menu",
"rows": [
{ "id": "opt1", "title": "Check Order Status" },
{ "id": "opt2", "title": "Talk to Support" }
]
}
]
}'Templates
/templatesList all approved templates
/templates/{id}Get template details
Response
{
"data": [
{
"id": 1,
"name": "order_confirmation",
"status": "APPROVED",
"category": "UTILITY",
"language": "en",
"components": [...],
"created_at": "2025-01-15T10:30:00.000000Z"
}
]
}Groups
/groupsList all contact groups
{
"data": [
{
"id": 1,
"name": "VIP Customers",
"contact_count": 150,
"created_at": "2025-01-15T10:30:00.000000Z"
}
]
}Campaigns
/campaignsList all campaigns
/campaigns/sendCreate and send a campaign
Send Campaign
curl -X POST "https://api.wacm.in/api/v1/campaigns/send" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Summer Sale 2025",
"template_id": 1,
"group_id": null,
"contact_id": null,
"variables": {
"1": "Summer Sale",
"2": "50% OFF"
}
}'Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Campaign name |
| template_id | integer | Required | WhatsApp template ID |
| group_id | integer | Optional | Target group ID (null = all contacts) |
| contact_id | integer | Optional | Specific contact ID (override) |
| variables | object | Optional | Template variable values |
| is_bot | boolean | Optional | Enable as bot reply |
| trigger | string | Optional | Comma-separated trigger keywords |
Conversations
/conversationsList all conversations
/conversations/{id}/messagesGet conversation messages
Get Conversation Messages
{
"data": [
{
"id": 1,
"contact_id": 123,
"value": "Hello! How can I help you?",
"is_message_by_contact": 0,
"message_type": 1,
"status": 4,
"created_at": "2025-01-15T10:30:00.000000Z"
},
{
"id": 2,
"contact_id": 123,
"value": "I need help with my order",
"is_message_by_contact": 1,
"message_type": 1,
"status": 4,
"created_at": "2025-01-15T10:31:00.000000Z"
}
]
}Message Types Reference
| Type | Code | Description |
|---|---|---|
| TEXT | 1 | Plain text message |
| MEDIA | 2 | Image, video, document, or audio |
| LOCATION | 3 | Location share (Google Maps) |
| NFM_REPLY | 5 | Interactive flow reply |
Message Status Codes
Error Responses
Error Response Format
{
"message": "The phone number is required.",
"errors": {
"phone": ["The phone field is required."]
}
}eCommerce Store API
Manage products, categories, and orders.