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.
Pagination
List endpoints (contacts, campaigns, conversations) return paginated responses. Use ?page= and ?limit= query parameters:
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://api.wacm.in/api/v1/contacts?page=2&limit=20"{
"data": [...],
"links": {
"first": "...",
"last": "...",
"prev": "...",
"next": "..."
},
"meta": {
"current_page": 2,
"last_page": 5,
"per_page": 20,
"total": 100
}
}Use ?search= to filter results by name or phone number.
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 (page, limit, search)
/contactsCreate a new contact
/contacts/{id}Get contact details with groups and fields
/contacts/{id}Update contact information
/contacts/{id}Delete contact
/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)
GET vs POST
Message endpoints support both GET and POST methods. Use POST for complex payloads (templates, lists). Use GET for simple text messages where parameters are passed as query strings.
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 with pagination (page, limit, search)
/campaignsCreate a new campaign
/campaigns/{id}Get campaign statistics and details
/campaigns/{id}Update campaign status (pause/resume)
/campaigns/{id}Delete a campaign
/campaigns/sendDispatch a campaign message to a contact dynamically
Create Campaign
curl -X POST "https://api.wacm.in/api/v1/campaigns" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Summer Sale 2025",
"template_id": 1,
"group_id": null,
"send_now": true,
"paramvalues": {
"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) |
| send_now | boolean | Optional | Send immediately (true) or schedule later (false) |
| send_time | string | Optional | Time to send if send_now is false |
| paramvalues | object | Optional | Template variable mapping values |
| file | Optional | Multipart form data for PDF attachments | |
| imageupload | file | Optional | Multipart form data for Image/Video attachments |
Conversations
/conversationsList all conversations with pagination (page, limit, search)
/conversations/{id}/messagesGet conversation messages with pagination (limit, before_id, search)
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.