API Documentation

HomeDeveloperDocumentation

Quick Start

Welcome to the SocialAPI API. Build powerful WhatsApp messaging integrations directly into your applications.

Postman Collection
v2.1

Accelerate your development by importing our official Postman Collection. It includes pre-configured requests for all available endpoints, saving you time on manual setup.

API Collection

Contains all API v1 endpoints with example payloads and dynamic variables.

Environment Config

Rapidly switch between environments using our pre-defined variables.

How to Import
  1. Download both the **Collection** and **Environment** JSON files above.
  2. Open Postman and click the **Import** button in the top left.
  3. Drag and drop both files into the import area.
  4. Select the imported environment and replace `YOUR_API_TOKEN_HERE` with your actual token.
Authentication

Authenticate your requests by including your API token in the Authorization header.

Authorization: Bearer <YOUR_TOKEN>

Templates
GET/api/v1/templates

Retrieve a list of all WhatsApp templates available for your company.

POST/api/v1/templates

Create a new WhatsApp Template. To add an attachment (media), specify a HEADER component with format IMAGE, VIDEO, or DOCUMENT.

Request Body (Example with Image Header)
{
  "name": "my_media_template",
  "category": "MARKETING",
  "language": "en_US",
  "components": [
    {
      "type": "HEADER",
      "format": "IMAGE",
      "example": { "header_handle": ["<upload_handle_id>"] }
    },
    {
      "type": "BODY",
      "text": "Hello {{1}}, check out this image!",
      "example": { "body_text": [["John"]] }
    },
    {
      "type": "FOOTER",
      "text": "Reply STOP to unsubscribe"
    },
    {
      "type": "BUTTONS",
      "buttons": [
         { "type": "QUICK_REPLY", "text": "Yes, I am interested" }
      ]
    }
  ]
}

Campaigns
GET/api/v1/campaigns

List all your campaigns.

GET/api/v1/campaigns/123

Get details of a specific campaign, including its status and statistics.

POST/api/v1/campaigns

Create a draft campaign. You can specify precise recipients for testing or transactional use.

Request Body
{
  "name": "Summer Sale Blast",
  "template_name": "hello_world",
  "language": "en_US",
  "recipients": ["919876543210"],
  "whatsapp_number_key": "AK7MXP2RBNCQ",
  "variables": ["John", "10% Off"],
  "header_media_url": "https://example.com/promo.jpg"
}
Response
{
  "message": "Campaign initiated...",
  "campaign_id": 123,
  "total_contacts": 1
}
Dynamic Variables & Media

You can optionally pass global variables (array of strings for {{1}}, {{2}}), header_variable, header_media_url, and header_media_type the exact same way as the Send Template endpoint. These act as fallbacks if the system cannot auto-resolve placeholders from your contact list.

POST/api/v1/campaigns/123/send

Trigger the sending process for a campaign.


Send Messages
POST/api/v1/messages/text

Send a standard text message to a user.

{
  "to": "1234567890",
  "text": "Hello, this is a test message from API.",
  "whatsapp_number_key": "AK7MXP2RBNCQ"
}
POST/api/v1/messages/attachment

Send media (image, video, document, audio) via URL.

{
  "to": "1234567890",
  "type": "image",
  "url": "https://example.com/image.png",
  "caption": "Check this out!",
  "whatsapp_number_key": "AK7MXP2RBNCQ"
}

Supported types: image, video, audio, document.

POST/api/v1/messages/template

Send a template message with dynamic variables. We support a simplified payload format for easy integration.

{
   "to": "1234567890",
   "template_name": "welcome_user",
   "language": "en_US",
   "variables": ["John", "123"],
   "header_variable": "Order #456",
   "header_media_url": "https://example.com/invoice.pdf",
   "header_media_type": "document",
   "whatsapp_number_key": "AK7MXP2RBNCQ"
 }
Field Definitions
  • to: (Required) Recipient's phone number with country code (e.g., "919876543210").
  • template_name: (Required) The unique name of the approved template.
  • whatsapp_number_key: (Optional) The unique 12-char key for your WhatsApp account. Find this in Developer Settings.
  • language: (Optional) Language code. Defaults to "en_US".
  • variables: Array of strings for body parameters {{1}}, {{2}}, etc.
  • header_variable: (Optional) String for a text header parameter {{1}}.
  • header_media_url: (Optional) URL for image/video/document header.
  • header_media_type: (Optional) image, video, or document. Defaults to image.

Contacts
POST/api/v1/contacts/import

Import or update contacts in bulk. Requires a JSON array of contact objects. No limit applies to how many contacts you can import.

{
  "contacts": [
    {
       "country_code": "91",
       "phone": "9876543210",
       "first_name": "John",
       "last_name": "Doe",
       "tags": ["lead", "vip"]
    },
    { "phone": "15550001234" }
  ]
}
Response
{
  "message": "Import queued successfully.",
  "queued": 2
}
Understanding contact_limit in the Profile API

When you call /api/profile, the response includes a subscription object with:

  • contact_limit — The maximum number of unique recipients you can send messages to in the current billing cycle (Monthly Unique Contacts). Not a storage limit.
  • contact_count — The total number of stored contacts in your workspace (informational only, not enforced).
  • is_unlimited_contactstrue if your plan has no MUC restriction (Ultimate/Agency plans).

If a campaign or message send would push your unique recipient count above contact_limit, the API returns HTTP 400 with an error message and automatically notifies your account email to upgrade.