WAB2C LogoWAB2C
PricingDevelopersResources
Sign InSign Up
DevelopersAPI DocumentationV2
Platform DocumentationWebhook ReferenceSDK Downloads

API Documentation

V2

Complete reference for the WAB2C WhatsApp Business API v2. Build integrations, automate messaging, manage contacts, and extend your WhatsApp operations programmatically.

V2 API Release

This is the current production API. All endpoints use the /api/ prefix. Previous v1 endpoints have been deprecated and are no longer supported.

Base URL & Endpoint Structure

All WAB2C API requests are made against the following base URL. Your tenant subdomain is part of the URL path to isolate your workspace data.

text
Base URL:      https://app.wab2c.com/api/
Tenant Path:   https://app.wab2c.com/api/{tenant}/
Example:       https://app.wab2c.com/api/mycompany/contacts
ParameterTypeRequiredDescription
Base URLstringRequiredRoot URL for all API calls: https://app.wab2c.com/api/
{tenant}stringRequiredYour unique tenant subdomain (e.g., mycompany, lahore-mart)
Resource PathstringRequiredThe specific resource you are accessing (e.g., /contacts, /messages/send)

Authentication

All API requests must include a Bearer token in the Authorization header. Generate your API token from the API Management section in your WAB2C tenant settings.

http
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

How to Generate Your API Token

  1. 1Log in to your WAB2C tenant panel at app.wab2c.com/tenant
  2. 2Navigate to Tenant Settings → API Management
  3. 3Toggle "Enable API Access" to ON
  4. 4Click "Generate New Token" to create your authentication token
  5. 5Copy the token immediately — it will not be shown again
  6. 6Save your changes to activate

Token Security

Never expose your API token in client-side code, public repositories, or browser requests. Store tokens securely in environment variables on your server. Rotate tokens periodically for security.

Token Abilities (Permissions)

API tokens have granular permissions. Configure abilities when generating your token to follow the principle of least privilege.

CategoryPermissionsDescription
Contacts
CreateReadUpdateDelete
Full CRUD access to contact records
Statuses
CreateReadUpdateDelete
Manage contact and campaign statuses
Sources
CreateReadUpdateDelete
Manage lead and contact sources
Groups
CreateReadUpdateDelete
Manage contact groups for segmentation
Templates
Read
Access approved WhatsApp message templates
Message Bots
Read
View message bot configurations
Template Bots
Read
View template bot configurations
Message Sending
TextMediaTemplate
Permission to send WhatsApp messages by type

Send Text Message

POST/api/{tenant}/messages/send

Send a plain text WhatsApp message to a phone number.

ParameterTypeRequiredDescription
phone_numberstringRequiredRecipient phone with country code (e.g., +923001234567)
typestringRequiredMessage type: "text"
messagestringRequiredThe text content of the message

Code Examples

curl -X POST "https://app.wab2c.com/api/{tenant}/messages/send" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "phone_number": "+923001234567",
    "type": "text",
    "message": "Assalam o Alaikum! Your order #1042 has been confirmed. Thank you for shopping with us."
  }'

Success Response (200)

json
{
  "success": true,
  "message": "Message sent successfully",
  "data": {
    "message_id": "wamid.HBgLOTIzMDAxMjM0NTY3...",
    "phone_number": "+923001234567",
    "status": "sent"
  }
}

Send Media Message

POST/api/{tenant}/messages/media

Send an image, document, video, or audio file via WhatsApp.

ParameterTypeRequiredDescription
phone_numberstringRequiredRecipient phone with country code
typestringRequired"image", "document", "video", or "audio"
media_urlstringRequiredPublic URL of the media file
captionstringOptionalOptional caption for the media
filenamestringOptionalFilename for document type

Supported Media Types

Refer to Meta's supported media types for file format and size limits. Images: 5 MB, Documents: 100 MB, Videos: 16 MB, Audio: 16 MB.

Send Template Message

POST/api/{tenant}/messages/template

Send a pre-approved WhatsApp template message with dynamic variables.

ParameterTypeRequiredDescription
phone_numberstringRequiredRecipient phone with country code (e.g., +923001234567)
template_namestringRequiredName of the approved WhatsApp template
template_languagestringRequiredLanguage code (e.g., "en", "ur")
field_1stringOptionalValue for template variable {{1}}
field_2stringOptionalValue for template variable {{2}}
field_3stringOptionalValue for template variable {{3}}
header_media_urlstringOptionalMedia URL for header (image/document/video templates)

Code Examples

curl -X POST "https://app.wab2c.com/api/{tenant}/messages/template" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "phone_number": "+923001234567",
    "template_name": "order_confirmation",
    "template_language": "en",
    "field_1": "Ahmed",
    "field_2": "PKR 4,500",
    "field_3": "12 Feb 2026"
  }'

Template Variables

Field numbers (field_1, field_2, etc.) correspond to the {{1}}, {{2}} placeholders in your approved WhatsApp template. Ensure the order matches your template structure.

Send Auth Template (OTP)

Send WhatsApp authentication templates for OTP verification. Supports auto-generated OTPs, manual OTPs, and automatic contact creation during signup flows.

POST/api/{tenant}/messages/template

Send an authentication template with OTP verification.

Method 1: Auto-Generate OTP

WAB2C generates a random OTP, inserts it into your template, sends it, and returns the OTP in the response.

ParameterTypeRequiredDescription
phone_numberstringRequiredRecipient phone with country code
template_namestringRequiredApproved auth template name (e.g., verify_otp)
template_languagestringRequiredLanguage code (en, ur, etc.)
auto_generate_otpbooleanRequiredSet to true for auto OTP generation

Method 2: Manual OTP

Send an OTP generated by your own system. Pass the OTP as field_1.

json
{
  "phone_number": "+923451234567",
  "template_name": "verify_otp",
  "template_language": "en",
  "field_1": "847293"
}

Method 3: OTP + Auto Contact Creation

Send an auth template and automatically create a contact in WAB2C if the phone number does not already exist. Ideal for signup verification flows.

curl -X POST "https://app.wab2c.com/api/{tenant}/messages/template" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "phone_number": "+923331234567",
    "template_name": "verify_otp",
    "template_language": "en",
    "auto_generate_otp": true,
    "contact": {
      "firstname": "Fatima",
      "lastname": "Khan",
      "email": "fatima.khan@example.com"
    }
  }'
ParameterTypeRequiredDescription
contactobjectRequiredContact information to create
contact.firstnamestringRequiredFirst name
contact.lastnamestringOptionalLast name
contact.emailstringOptionalEmail address

Success Response (200)

json
{
  "success": true,
  "message": "Template sent successfully",
  "data": {
    "message_id": "wamid.HBgLOTIzMzMxMjM0NTY3...",
    "phone_number": "+923331234567",
    "otp": "847293",
    "status": "sent"
  }
}

Message Status

GET/api/{tenant}/messages/{message_id}

Retrieve the delivery status of a sent message.

json
{
  "success": true,
  "data": {
    "message_id": "wamid.HBgLOTIzMDAxMjM0NTY3...",
    "status": "delivered",
    "timestamp": "2026-02-17T10:30:00Z"
  }
}

Contacts API

Create Contact

POST/api/{tenant}/contacts

Create a new contact in your WAB2C CRM.

ParameterTypeRequiredDescription
firstnamestringRequiredContact first name
lastnamestringOptionalContact last name
phonestringRequiredPhone with country code (e.g., +923211234567)
emailstringOptionalEmail address
companystringOptionalCompany or organization name
citystringOptionalCity (e.g., Lahore, Karachi, Islamabad)
status_idintegerOptionalStatus ID to assign
source_idintegerOptionalSource ID to assign
group_idsarrayOptionalArray of group IDs to assign

Code Examples

curl -X POST "https://app.wab2c.com/api/{tenant}/contacts" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "firstname": "Ali",
    "lastname": "Raza",
    "phone": "+923211234567",
    "email": "ali.raza@example.com",
    "company": "Lahore Traders",
    "city": "Lahore"
  }'

List Contacts

GET/api/{tenant}/contacts

Retrieve a paginated list of all contacts.

ParameterTypeRequiredDescription
pageintegerOptionalPage number (default: 1)
per_pageintegerOptionalResults per page (default: 25, max: 100)
searchstringOptionalSearch by name, phone, or email

Update Contact

PUT/api/{tenant}/contacts/{id}

Update an existing contact record.

http
PUT /api/{tenant}/contacts/142

{
  "firstname": "Ali",
  "lastname": "Ahmed",
  "company": "Karachi Electronics",
  "city": "Karachi"
}

Delete Contact

DELETE/api/{tenant}/contacts/{id}

Permanently delete a contact record.

Irreversible Action

Deleting a contact removes all associated conversation history. This action cannot be undone.

Statuses API

Manage contact and lead statuses programmatically. Statuses help categorize contacts by pipeline stage (e.g., New, Qualified, Converted, Closed).

POST/api/{tenant}/statuses

Create a new status.

GET/api/{tenant}/statuses

List all statuses.

PUT/api/{tenant}/statuses/{id}

Update a status.

DELETE/api/{tenant}/statuses/{id}

Delete a status.

http
POST /api/{tenant}/statuses

{
  "name": "Interested",
  "color": "#22c55e",
  "description": "Lead has shown interest in our services"
}

Sources API

Manage lead and contact sources to track where your contacts originated (e.g., Website, Facebook Ad, Referral, Walk-in).

POST/api/{tenant}/sources

Create a new source.

GET/api/{tenant}/sources

List all sources.

PUT/api/{tenant}/sources/{id}

Update a source.

DELETE/api/{tenant}/sources/{id}

Delete a source.

http
POST /api/{tenant}/sources

{
  "name": "Facebook Ads - Lahore Campaign",
  "description": "Leads from Feb 2026 Facebook campaign targeting Lahore"
}

Groups API

Organize contacts into groups for targeted campaign segmentation and bulk operations.

POST/api/{tenant}/groups

Create a new contact group.

GET/api/{tenant}/groups

List all groups.

PUT/api/{tenant}/groups/{id}

Update a group.

DELETE/api/{tenant}/groups/{id}

Delete a group.

http
POST /api/{tenant}/groups

{
  "name": "VIP Customers - Islamabad",
  "description": "High-value customers from Islamabad region"
}

Templates API

GET/api/{tenant}/templates

Retrieve all approved WhatsApp message templates linked to your WABA.

json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "order_confirmation",
      "language": "en",
      "status": "APPROVED",
      "category": "UTILITY",
      "components": [
        {
          "type": "BODY",
          "text": "Assalam o Alaikum {{1}}, your order worth {{2}} has been confirmed and will be delivered by {{3}}."
        }
      ]
    }
  ]
}

Read-Only Access

Templates are managed through your WhatsApp Business Account on Meta. The API provides read-only access to fetch approved templates for use in messaging and campaigns. Visit the Template Management guide for creation workflows.

Bots API

GET/api/{tenant}/message-bots

List all configured message bots and their trigger keywords.

GET/api/{tenant}/template-bots

List all configured template bots and their templates.

Bot Configuration

Bots are configured through the WAB2C dashboard. The API provides read-only access. See Message Bot, Template Bot, and Bot Flow Builder documentation for setup guides.

Webhooks

Receive real-time notifications when events occur in your WAB2C tenant. Configure a webhook URL in Tenant Settings to receive instant updates for contacts, statuses, and sources.

Setup Steps

  1. 1Go to Tenant Settings → Webhook Integrations at app.wab2c.com/tenant
  2. 2Toggle "Enable Webhook Access" to ON
  3. 3Enter your Webhook URL (e.g., https://your-app.com/api/wab2c-webhook)
  4. 4Click Save Changes to activate
  5. 5Test using webhook.site or your own endpoint

Webhook Events

CategoryEventTriggered When
Contactscontact.createdA new contact is added
Contactscontact.readA contact record is accessed
Contactscontact.updatedA contact is modified
Contactscontact.deletedA contact is removed
Statusesstatus.createdA new status is created
Statusesstatus.updatedA status is modified
Statusesstatus.deletedA status is removed
Sourcessource.createdA new source is added
Sourcessource.updatedA source is modified
Sourcessource.deletedA source is removed

Webhook Handler Examples

# Webhook events are sent TO your endpoint.
# Test with:
curl -X POST "https://your-app.com/api/wab2c-webhook" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "contact.created",
    "data": {
      "id": 142,
      "firstname": "Zain",
      "phone": "+923451234567"
    }
  }'

WooCommerce Integration

Connect your WooCommerce store to WAB2C to send automatic WhatsApp order notifications, shipping updates, and abandoned cart reminders.

Setup Steps

  1. 1Access Webhook Settings

    Navigate to WooCommerce → Settings → Advanced → Webhooks

  2. 2Create New Webhook

    Click "Add webhook" and configure the webhook data box

  3. 3Configure Settings

    Set Name (e.g., "WAB2C Order Notifications"), Status to Active, and Topic to "Order Created"

  4. 4Set Delivery URL

    Enter your WAB2C webhook endpoint URL from the Webhook Dashboard

  5. 5Save Webhook

    Click Save. WooCommerce sends a test ping on first activation.

Available Webhook Topics

Order Created
Order Updated
Order Deleted
Product Created
Product Updated
Customer Created

eCommerce Webhook Dashboard

The Webhook Dashboard in your WAB2C tenant provides a centralized interface to create, monitor, and manage all eCommerce webhook integrations.

Create & Manage

Multiple webhooks with unique endpoints

Monitor Activity

Real-time performance metrics

Configure Endpoints

Custom authentication & settings

Track Success Rates

Request statistics & analytics

Test & Debug

Built-in testing tools

Secure Auth

Secret key verification

text
Webhook URL Format:
https://app.wab2c.com/api/webhooks/{webhook_id}

Use this URL as the Delivery URL in WooCommerce, Shopify, or any eCommerce platform.

Rate Limits

API rate limits are enforced per token. Exceeding limits returns a 429 Too Many Requests response.

PlanRequests / minMessages / day
Starter601,000
Growth1205,000
Pro30015,000
Enterprise600Unlimited

Error Codes

StatusDescriptionSolution
200SuccessRequest completed successfully
400Bad RequestCheck request body and parameters
401UnauthorizedVerify API token is valid and included
403ForbiddenToken lacks required permissions (check Token Abilities)
404Not FoundCheck endpoint URL and tenant subdomain
422Validation ErrorReview required fields and data types
429Rate LimitedReduce request frequency; retry after delay
500Server ErrorRetry request; contact WAB2C support if persistent

Error Response Format

json
{
  "success": false,
  "message": "Error description",
  "errors": {
    "phone_number": ["The phone number field is required."],
    "template_name": ["The selected template was not found."]
  }
}

Best Practices

Token Security

Store API tokens in server-side environment variables. Never expose tokens in client-side code or public repos.

Phone Number Format

Always include the country code with + prefix (e.g., +923001234567 for Pakistan). Never include spaces or dashes.

Template Approval

Ensure WhatsApp templates are approved before sending. Sending unapproved templates will fail silently.

Retry Logic

Implement exponential backoff for 429 and 5xx errors. Wait at least 1 second before retrying.

Validate Inputs

Validate phone numbers and required fields on your side before making API calls to reduce errors.

Use HTTPS

All API endpoints use HTTPS. Never send API requests over plain HTTP.

Need Integration Help?

Our engineering team is available to assist with your V2 API integration.

Chat with an EngineerBrowse Documentation

Product

  • Team Inbox
  • Broadcast Campaigns
  • WhatsApp Chatbot
  • Flow Builder
  • AI Assistant
  • Ecommerce Automation

Solutions

  • WhatsApp Marketing
  • Lead Generation
  • Customer Support
  • Ecommerce Automation
  • Order Tracking
  • COD Verification

Industries

  • Ecommerce
  • Food Delivery
  • Fashion & Beauty
  • Education
  • Healthcare
  • Real Estate
  • Financial Services
  • Travel & Hospitality

Resources

  • Blog
  • Academy
  • Template Library
  • Case Studies
  • Guides & Tutorials
  • ROI Calculator
  • Compare
  • Free Tools
  • Infographics

Developers

  • API Documentation
  • Webhooks
  • SDK Libraries
  • Sample Apps
  • Changelog
  • Status

Company

  • About Us
  • Why WAB2C
  • Customers
  • Partners
  • Careers
  • Contact

Official Partners & Certifications

Meta Business PartnerMeta Verified Tech ProviderSAP Partner
Join ourWhatsApp Business APIPakistan – Community Hub
Join Our WhatsApp ChannelWhatsApp Business APIPakistan
WAB2C LogoWAB2C

Pakistan's leading WhatsApp Business API platform. Automate campaigns, build chatbots, and grow your ecommerce — all with PKR pricing.

Contact Us

hello@wab2c.com+92 330 0003097
Karachi, Pakistan

Pakistan

  • WhatsApp API Karachi
  • WhatsApp API Lahore
  • WhatsApp API Islamabad

© 2026 WAB2C. All rights reserved.

PrivacyTermsSecurityCompliance
Official Meta Partner