WhatsApp Business API
Wpbox API Reference
Integrate with WhatsApp Cloud API to send messages, manage contacts, run campaigns, and automate customer communication at scale.
WhatsApp API - LLM Context
LLM ReadyFeed complete WhatsApp Business API specs directly to your AI agent or coding assistant.
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://app.wacm.in/api/v1All endpoints require authentication via Bearer token or query parameter. The API supports standard RESTful conventions with JSON request and response bodies.
Pagination
List endpoints (contacts, campaigns, conversations) return paginated responses. Use ?page= and ?limit= query parameters:
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://app.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
},
"status": "success",
"message": "Contacts retrieved successfully"
}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://app.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://app.wacm.in/webhook/wpbox/receive/{your_token}The webhook accepts both GET (verification) and POST (message delivery) requests. Use your personal webhook 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 and company context
{
"status": "success",
"message": "Profile retrieved successfully",
"data": {
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"company_name": "Acme Corp"
}
}Contacts
/contactsList all contacts with pagination (page, limit, search, group_id, tag_id, filter_condition)
/contactsCreate or update a contact with groups, tags, and custom fields
/contacts/bulk-syncCreate or match contacts in bulk and optionally assign them to a group or tag
/contacts/{id}Get contact details with groups, tags, 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://app.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",
"city": "Mumbai",
"company_name": "Acme Corp"
}'Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | string | Required | WhatsApp phone number with country code |
| name | string | Optional | Contact full name |
| string | Optional | Contact email address | |
| city | string | Optional | City name |
| country_id | integer | Optional | Country ID reference |
| company_name | string | Optional | Company name |
| subscribed | boolean | Optional | Subscription / opt-in status (default: true) |
| enabled_ai_bot | boolean | Optional | Enable or disable AI chatbot for this contact |
| groups | array | Optional | Array of group IDs to assign |
| tags | array | Optional | Array of tag IDs to assign |
| fields | object | Optional | Key-value map of custom field values |
Response
{
"status": "success",
"message": "Contact created/updated successfully",
"data": {
"id": 123,
"name": "John Doe",
"phone": "+919876543210",
"email": "john@example.com",
"city": "Mumbai",
"country": "India",
"company": "Acme Corp",
"subscribed": true,
"is_on_whatsapp": true,
"enabled_ai_bot": true,
"groups": [
{ "id": 1, "name": "VIP Customers" }
],
"tags": [
{ "id": 1, "name": "Lead", "color": "#10B981" }
],
"custom": {},
"created_at": "2025-01-15T10:30:00.000000Z",
"updated_at": "2025-01-15T10:30:00.000000Z"
}
}Bulk Sync and Group Assignment
Submit one or more contacts and optionally provide a company-owned group_id or tag_id. Existing contacts are matched by normalized phone number, new contacts are created within plan limits, and assignments are additive and idempotent.
curl -X POST "https://app.wacm.in/api/v1/contacts/bulk-sync" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contacts": [
{"phone": "9876543210", "name": "Jane Doe"},
{"phone": "+919876543211", "name": "John Doe"}
],
"country_code": "91",
"group_id": 123
}'Bulk Sync Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| contacts | array | Required | Non-empty contact list; every item requires a phone containing at least one digit |
| contacts[].phone | string | Required | Phone number; normalized before matching |
| contacts[].name | string | Optional | Contact name |
| country_code | string | Optional | Country calling code applied to local numbers |
| group_id | integer | Optional | Group ID owned by the authenticated company |
| tag_id | integer | Optional | Tag ID owned by the authenticated company |
{
"status": "success",
"message": "Contacts synced successfully",
"data": {
"synced_count": 2,
"updated_count": 0,
"created_count": 2,
"skipped_limit_count": 0
}
}Messages
/messages/textSend a text, media, or quick-reply button message
/messages/textSend a text message (GET)
/messages/templateSend an approved template message with component parameters
/messages/templateSend template message (GET)
/messages/listSend an interactive list message
/messages/listSend list message (GET)
Send Text / Media Message
curl -X POST "https://app.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 | Optional | Message text content |
| media_url | string (URL) | Optional | Direct URL to media attachment (image, document, audio, video) |
| image | file | Optional | Multipart file upload |
| buttons | array | Optional | Array of up to 3 quick-reply buttons with id and title |
| header | string | Optional | Optional header text |
| footer | string | Optional | Optional footer text |
| button_name | string | Optional | Call-to-action button label |
| button_url | string (URL) | Optional | Call-to-action button URL |
Send Template Message
curl -X POST "https://app.wacm.in/api/v1/messages/template" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "+919876543210",
"template_name": "order_confirmation",
"template_language": "en",
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "John Doe" },
{ "type": "text", "text": "ORD-12345" }
]
}
]
}'Template Message Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | string | Required | Recipient WhatsApp number |
| template_name | string | Required | Meta-approved template name |
| template_language | string | Optional | Language code (default: en). Alias: language |
| components | array | Optional | Standard WhatsApp Cloud API component array |
| variables | array/object | Optional | Legacy body variable mapping (automatically transformed to components) |
| header_variables | array | Optional | Legacy header variable mapping |
| scheduled_at | string | Optional | ISO date string to schedule message for future delivery |
| timezone | string | Optional | Timezone for scheduled delivery |
Send Interactive List Message
curl -X POST "https://app.wacm.in/api/v1/messages/list" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "+919876543210",
"message": "Please select from the options below:",
"header": "Main Menu",
"footer": "Powered by WACM",
"action": {
"button": "View Options",
"sections": [
{
"title": "Menu Options",
"rows": [
{ "id": "opt1", "title": "Check Order Status", "description": "Track your recent order" },
{ "id": "opt2", "title": "Talk to Support", "description": "Connect with an agent" }
]
}
]
}
}'List Message Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | string | Required | Recipient WhatsApp number |
| message | string | Required | Main body message |
| action | object | Required | Interactive action configuration containing button label and sections list |
| header | string | Optional | Optional text header |
| footer | string | Optional | Optional text footer |
Templates
/templatesList all approved templates (supports ?name= filter)
/templatesCreate and submit a new WhatsApp template to Meta
/templates/{id}Get template details
/templates/syncSync all templates from WhatsApp Business Account
/templates/{id}/syncSync a single template status from Meta
/templates/{id}Delete template from WhatsApp and local database
Response
{
"data": [
{
"id": 1,
"name": "order_confirmation",
"language": "en",
"status": "APPROVED",
"category": "UTILITY",
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your order {{2}} has been confirmed!"
}
],
"created_at": "2025-01-15T10:30:00.000000Z",
"updated_at": "2025-01-15T10:30:00.000000Z"
}
],
"status": "success",
"message": "Templates retrieved successfully"
}Groups
/groupsList contact groups with contacts_count
/groupsCreate a contact group
/groups/{id}Rename a contact group
/groups/{id}Delete a contact group and detach its contacts
/groups/{id}/check-phonesCheck WhatsApp presence for all contacts in a group in background
{
"status": "success",
"message": "Groups retrieved successfully",
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"name": "VIP Customers",
"contacts_count": 150,
"created_at": "2025-01-15T10:30:00.000000Z",
"updated_at": "2025-01-15T10:30:00.000000Z"
}
],
"total": 1
}
}Campaigns
/campaignsList all campaigns with pagination (page, limit, search, type)
/campaignsCreate and dispatch a new campaign
/campaigns/audience-previewPreview eligible opted-in contacts count before launching
/campaigns/{id}Get campaign statistics and details
/campaigns/{id}/messagesList campaign message delivery transactions with status filter
/campaigns/{id}Update campaign status (pause/resume with is_active)
/campaigns/{id}Delete a campaign
/campaigns/sendDispatch a campaign template message to a single contact dynamically
Audience Preview
curl -X POST "https://app.wacm.in/api/v1/campaigns/audience-preview" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"audience_type": "group",
"group_id": 1,
"template_id": 12,
"prevent_template_duplicates": true
}'{
"status": "success",
"message": "Campaign audience preview retrieved successfully",
"data": {
"audience_type": "group",
"eligible_contacts": 142
}
}Create Campaign
curl -X POST "https://app.wacm.in/api/v1/campaigns" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Summer Sale 2025",
"template_id": 1,
"audience_type": "all",
"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 | Approved WhatsApp template ID |
| audience_type | string | Required | Target audience: "all", "group", or "contact" |
| group_id | integer | Optional | Required if audience_type is "group". Prohibited otherwise. |
| contact_id | integer | Optional | Required if audience_type is "contact". Prohibited otherwise. |
| send_now | boolean | Optional | Send immediately (true, default) or schedule later (false) |
| send_time | string | Optional | ISO date string to send if send_now is false |
| prevent_template_duplicates | boolean | Optional | Exclude contacts that already received this template |
| 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, lastmessagetime)
/conversations/{id}/messagesGet conversation messages with pagination (limit, before_id, search, lastmessagetime)
Get Conversation Messages
{
"data": [
{
"id": 1,
"fb_message_id": "wamid.HBgM...",
"contact_id": 123,
"value": "Hello! How can I help you?",
"status": 4,
"is_message_by_contact": 0,
"message_type": 1,
"created_at": "2025-01-15T10:30:00.000000Z",
"updated_at": "2025-01-15T10:30:00.000000Z"
}
],
"status": "success",
"message": "Messages retrieved successfully"
}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.