WACM.in Logo
Back to API Docs

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 Ready

Feed complete WhatsApp Business API specs directly to your AI agent or coding assistant.

Download .mdOpenAPI 3.1
Machine-Readable Feeds:/llms.txt /llms-full.txt

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/v1

All 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:

Paginated Request
curl -H "Authorization: Bearer YOUR_TOKEN" \
     "https://app.wacm.in/api/v1/contacts?page=2&limit=20"
Paginated Response
{
  "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.

Example Request
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.

Webhook URL
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

Text Message Payload
{
  "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

Status Update Payload
{
  "entry": [{
    "changes": [{
      "value": {
        "messaging_product": "whatsapp",
        "statuses": [{
          "id": "wamid.XXX",
          "status": "delivered",
          "timestamp": "1234567890",
          "recipient_id": "919876543210"
        }]
      }
    }]
  }]
}

Profile

GET
/me

Get authenticated user profile and company context

Response
{
  "status": "success",
  "message": "Profile retrieved successfully",
  "data": {
    "id": 1,
    "name": "John Doe",
    "email": "john@example.com",
    "company_name": "Acme Corp"
  }
}

Contacts

GET
/contacts

List all contacts with pagination (page, limit, search, group_id, tag_id, filter_condition)

POST
/contacts

Create or update a contact with groups, tags, and custom fields

POST
/contacts/bulk-sync

Create or match contacts in bulk and optionally assign them to a group or tag

GET
/contacts/{id}

Get contact details with groups, tags, and fields

PUT
/contacts/{id}

Update contact information

DELETE
/contacts/{id}

Delete contact

GET
/contacts/{id}/groups-and-fields

Get contact groups and custom fields

GET
/contacts/{id}/notes

Get contact notes

POST
/contacts/check-phone

Check if phone number exists on WhatsApp

Create Contact

Request
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

ParameterTypeRequiredDescription
phonestringRequiredWhatsApp phone number with country code
namestringOptionalContact full name
emailstringOptionalContact email address
citystringOptionalCity name
country_idintegerOptionalCountry ID reference
company_namestringOptionalCompany name
subscribedbooleanOptionalSubscription / opt-in status (default: true)
enabled_ai_botbooleanOptionalEnable or disable AI chatbot for this contact
groupsarrayOptionalArray of group IDs to assign
tagsarrayOptionalArray of tag IDs to assign
fieldsobjectOptionalKey-value map of custom field values

Response

200 OK
{
  "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.

Request
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

ParameterTypeRequiredDescription
contactsarrayRequiredNon-empty contact list; every item requires a phone containing at least one digit
contacts[].phonestringRequiredPhone number; normalized before matching
contacts[].namestringOptionalContact name
country_codestringOptionalCountry calling code applied to local numbers
group_idintegerOptionalGroup ID owned by the authenticated company
tag_idintegerOptionalTag ID owned by the authenticated company
200 OK
{
  "status": "success",
  "message": "Contacts synced successfully",
  "data": {
    "synced_count": 2,
    "updated_count": 0,
    "created_count": 2,
    "skipped_limit_count": 0
  }
}

Messages

POST
/messages/text

Send a text, media, or quick-reply button message

GET
/messages/text

Send a text message (GET)

POST
/messages/template

Send an approved template message with component parameters

GET
/messages/template

Send template message (GET)

POST
/messages/list

Send an interactive list message

GET
/messages/list

Send list message (GET)

Send Text / Media Message

Request
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

ParameterTypeRequiredDescription
phonestringRequiredRecipient WhatsApp number
messagestringOptionalMessage text content
media_urlstring (URL)OptionalDirect URL to media attachment (image, document, audio, video)
imagefileOptionalMultipart file upload
buttonsarrayOptionalArray of up to 3 quick-reply buttons with id and title
headerstringOptionalOptional header text
footerstringOptionalOptional footer text
button_namestringOptionalCall-to-action button label
button_urlstring (URL)OptionalCall-to-action button URL

Send Template Message

Request (WhatsApp Cloud API Components)
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

ParameterTypeRequiredDescription
phonestringRequiredRecipient WhatsApp number
template_namestringRequiredMeta-approved template name
template_languagestringOptionalLanguage code (default: en). Alias: language
componentsarrayOptionalStandard WhatsApp Cloud API component array
variablesarray/objectOptionalLegacy body variable mapping (automatically transformed to components)
header_variablesarrayOptionalLegacy header variable mapping
scheduled_atstringOptionalISO date string to schedule message for future delivery
timezonestringOptionalTimezone for scheduled delivery

Send Interactive List Message

Request
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

ParameterTypeRequiredDescription
phonestringRequiredRecipient WhatsApp number
messagestringRequiredMain body message
actionobjectRequiredInteractive action configuration containing button label and sections list
headerstringOptionalOptional text header
footerstringOptionalOptional text footer

Templates

GET
/templates

List all approved templates (supports ?name= filter)

POST
/templates

Create and submit a new WhatsApp template to Meta

GET
/templates/{id}

Get template details

POST
/templates/sync

Sync all templates from WhatsApp Business Account

POST
/templates/{id}/sync

Sync a single template status from Meta

DELETE
/templates/{id}

Delete template from WhatsApp and local database

Response

200 OK
{
  "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

GET
/groups

List contact groups with contacts_count

POST
/groups

Create a contact group

PUT
/groups/{id}

Rename a contact group

DELETE
/groups/{id}

Delete a contact group and detach its contacts

POST
/groups/{id}/check-phones

Check WhatsApp presence for all contacts in a group in background

Response
{
  "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
  }
}

Tags & Custom Fields

GET
/tags

List all contact tags

POST
/tags

Create a new tag (name, color)

PUT
/tags/{id}

Update an existing tag name or color

DELETE
/tags/{id}

Delete a tag

GET
/fields

List company custom contact field definitions

Campaigns

GET
/campaigns

List all campaigns with pagination (page, limit, search, type)

POST
/campaigns

Create and dispatch a new campaign

POST
/campaigns/audience-preview

Preview eligible opted-in contacts count before launching

GET
/campaigns/{id}

Get campaign statistics and details

GET
/campaigns/{id}/messages

List campaign message delivery transactions with status filter

PUT
/campaigns/{id}

Update campaign status (pause/resume with is_active)

DELETE
/campaigns/{id}

Delete a campaign

POST
/campaigns/send

Dispatch a campaign template message to a single contact dynamically

Audience Preview

Request
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
  }'
200 OK
{
  "status": "success",
  "message": "Campaign audience preview retrieved successfully",
  "data": {
    "audience_type": "group",
    "eligible_contacts": 142
  }
}

Create Campaign

Request
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

ParameterTypeRequiredDescription
namestringRequiredCampaign name
template_idintegerRequiredApproved WhatsApp template ID
audience_typestringRequiredTarget audience: "all", "group", or "contact"
group_idintegerOptionalRequired if audience_type is "group". Prohibited otherwise.
contact_idintegerOptionalRequired if audience_type is "contact". Prohibited otherwise.
send_nowbooleanOptionalSend immediately (true, default) or schedule later (false)
send_timestringOptionalISO date string to send if send_now is false
prevent_template_duplicatesbooleanOptionalExclude contacts that already received this template
paramvaluesobjectOptionalTemplate variable mapping values
pdffileOptionalMultipart form data for PDF attachments
imageuploadfileOptionalMultipart form data for Image/Video attachments

Conversations

GET
/conversations

List all conversations with pagination (page, limit, search, lastmessagetime)

GET
/conversations/{id}/messages

Get conversation messages with pagination (limit, before_id, search, lastmessagetime)

Get Conversation Messages

Response
{
  "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

TypeCodeDescription
TEXT1Plain text message
MEDIA2Image, video, document, or audio
LOCATION3Location share (Google Maps)
NFM_REPLY5Interactive flow reply

Message Status Codes

0Scheduled - Message queued for sending
1Sending - Message being sent to WhatsApp
2Sent - WhatsApp accepted the message
3Delivered - Message delivered to device
4Read - Message read by recipient
5Failed - Message failed to send

Error Responses

400Bad Request - Invalid parameters or payload
401Unauthorized - Invalid or missing API token
403Forbidden - Insufficient permissions or plan limits
404Not Found - Resource does not exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong

Error Response Format

Error Response
{
  "message": "The phone number is required.",
  "errors": {
    "phone": ["The phone field is required."]
  }
}

eCommerce Store API

Manage products, categories, and orders.

View Docs