Skip to content
Developers

API documentation

Everything you need to send WhatsApp messages from your website, app or automation tool.

Introduction

The REST API lets you send WhatsApp messages, media, OTP codes and campaigns, manage contacts and receive events. All requests and responses use JSON.

Base URL https://bcmagency.net/wp-json/wpbcm/v1

Authentication

Create an API key from the dashboard (API keys page) and send it with every request in the "token" header. "Authorization: Bearer <key>" and the ?token= query parameter are also accepted.

token: YOUR_API_TOKEN

Rate limit: 120 requests per minute per key.

Safe retries (Idempotency-Key)

Add an "Idempotency-Key" header with a unique value (for example a UUID or your order ID) to any POST request. If the network fails and you send the same request again with the same key within 24 hours, the API returns the first result instead of sending the message twice. The replayed response carries the header "Idempotent-Replayed: true".

Idempotency-Key: order-1045-shipped

Responses & errors

Successful responses contain "success": true. Errors return an HTTP status code with a machine readable "code" and a human readable "message".

{
  "success": false,
  "code": "INSTANCE_NOT_CONNECTED",
  "message": "This WhatsApp number is not connected."
}
HTTPcodeMeaning
401TOKEN_MISSING / TOKEN_INVALIDMissing or invalid API key.
402SUBSCRIPTION_INACTIVENo active subscription.
404INSTANCE_NOT_FOUNDUnknown instance ID.
409INSTANCE_NOT_CONNECTEDThe number is not linked. Scan the QR code again.
409IDEMPOTENCY_CONFLICTA request with the same Idempotency-Key is still being processed.
422VALIDATION_ERROR / INVALID_PHONEA parameter is missing or invalid.
429RATE_LIMITED / QUOTA_EXCEEDEDToo many requests or plan limit reached.
502GATEWAY_ERRORWhatsApp could not deliver the request. Retry later.

Send a text message

POSThttps://bcmagency.net/wp-json/wpbcm/v1/send-message

Send a WhatsApp text message. Supports {{variables}} and spintax {Hi|Hello}.

ParameterRequiredDescription
instance_idNoInstance ID (e.g. ins_xxx). Defaults to your first connected number.
phoneYesRecipient in international format, e.g. 201001234567 (or a group JID).
messageYesMessage text (max 4096 characters).
varsNoObject of variables used in the message, e.g. {"name":"Ahmed"}.
schedule_atNoOptional ISO date/time to send later.
curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/send-message" \
  -H "token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_id": "ins_xxxxxxxx",
    "phone": "201001234567",
    "message": "Hello {{name}} 👋",
    "vars": {
        "name": "Ahmed"
    }
}'
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/send-message');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'instance_id' => 'ins_xxxxxxxx',
        'phone' => '201001234567',
        'message' => 'Hello {{name}} 👋',
        'vars' => [
            'name' => 'Ahmed'
        ]
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/send-message', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({
      "instance_id": "ins_xxxxxxxx",
      "phone": "201001234567",
      "message": "Hello {{name}} 👋",
      "vars": {
          "name": "Ahmed"
      }
  }),
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/send-message
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN
Send Body: ON → JSON
{
    "instance_id": "ins_xxxxxxxx",
    "phone": "201001234567",
    "message": "Hello {{name}} 👋",
    "vars": {
        "name": "Ahmed"
    }
}

Response

{
    "success": true,
    "message": "Message sent successfully.",
    "data": {
        "id": 1024,
        "instance_id": "ins_xxx",
        "direction": "out",
        "phone": "201001234567",
        "type": "text",
        "status": "sent",
        "provider_id": "3EB0C431C26A1916E1A8"
    }
}

Send media (image, video, audio, document)

POSThttps://bcmagency.net/wp-json/wpbcm/v1/send-media

Send a file from a public URL with an optional caption.

ParameterRequiredDescription
instance_idNoInstance ID (e.g. ins_xxx). Defaults to your first connected number.
phoneYesRecipient in international format, e.g. 201001234567 (or a group JID).
media_urlYesPublic URL of the file.
typeNoimage | video | audio | document
captionNoCaption text.
filenameNoFile name shown for documents.
curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/send-media" \
  -H "token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_id": "ins_xxxxxxxx",
    "phone": "201001234567",
    "media_url": "https://example.com/invoice.pdf",
    "type": "document",
    "caption": "Your invoice",
    "filename": "invoice.pdf"
}'
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/send-media');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'instance_id' => 'ins_xxxxxxxx',
        'phone' => '201001234567',
        'media_url' => 'https://example.com/invoice.pdf',
        'type' => 'document',
        'caption' => 'Your invoice',
        'filename' => 'invoice.pdf'
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/send-media', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({
      "instance_id": "ins_xxxxxxxx",
      "phone": "201001234567",
      "media_url": "https://example.com/invoice.pdf",
      "type": "document",
      "caption": "Your invoice",
      "filename": "invoice.pdf"
  }),
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/send-media
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN
Send Body: ON → JSON
{
    "instance_id": "ins_xxxxxxxx",
    "phone": "201001234567",
    "media_url": "https://example.com/invoice.pdf",
    "type": "document",
    "caption": "Your invoice",
    "filename": "invoice.pdf"
}

Send a saved template

POSThttps://bcmagency.net/wp-json/wpbcm/v1/send-template

Send one of your message templates with variables. For Cloud API numbers you can send approved Meta templates with cloud_template.

ParameterRequiredDescription
instance_idNoInstance ID (e.g. ins_xxx). Defaults to your first connected number.
phoneYesRecipient in international format, e.g. 201001234567 (or a group JID).
template_idYesTemplate ID from GET /templates.
varsNoObject of variables used in the message, e.g. {"name":"Ahmed"}.
cloud_templateNo{"name":"order_update","language":"ar","params":["Ahmed","#1001"]}
curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/send-template" \
  -H "token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "201001234567",
    "template_id": 3,
    "vars": {
        "name": "Ahmed",
        "order": "#1001"
    }
}'
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/send-template');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'phone' => '201001234567',
        'template_id' => 3,
        'vars' => [
            'name' => 'Ahmed',
            'order' => '#1001'
        ]
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/send-template', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({
      "phone": "201001234567",
      "template_id": 3,
      "vars": {
          "name": "Ahmed",
          "order": "#1001"
      }
  }),
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/send-template
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN
Send Body: ON → JSON
{
    "phone": "201001234567",
    "template_id": 3,
    "vars": {
        "name": "Ahmed",
        "order": "#1001"
    }
}

Send a location

POSThttps://bcmagency.net/wp-json/wpbcm/v1/send-location

Share a map location pin.

ParameterRequiredDescription
phoneYesRecipient in international format, e.g. 201001234567 (or a group JID).
latitudeYes30.0444
longitudeYes31.2357
nameNoPlace name.
addressNoAddress.
curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/send-location" \
  -H "token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "201001234567",
    "latitude": 30.0444,
    "longitude": 31.2357,
    "name": "Our store"
}'
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/send-location');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'phone' => '201001234567',
        'latitude' => 30.0444,
        'longitude' => 31.2357,
        'name' => 'Our store'
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/send-location', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({
      "phone": "201001234567",
      "latitude": 30.0444,
      "longitude": 31.2357,
      "name": "Our store"
  }),
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/send-location
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN
Send Body: ON → JSON
{
    "phone": "201001234567",
    "latitude": 30.0444,
    "longitude": 31.2357,
    "name": "Our store"
}

Check numbers on WhatsApp

POSThttps://bcmagency.net/wp-json/wpbcm/v1/check-number

Check whether phone numbers have WhatsApp accounts (QR numbers only, up to 50 per request).

ParameterRequiredDescription
phonesYesArray of phone numbers.
curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/check-number" \
  -H "token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phones": [
        "201001234567",
        "201112223334"
    ]
}'
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/check-number');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'phones' => [
            '201001234567',
            '201112223334'
        ]
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/check-number', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({
      "phones": [
          "201001234567",
          "201112223334"
      ]
  }),
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/check-number
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN
Send Body: ON → JSON
{
    "phones": [
        "201001234567",
        "201112223334"
    ]
}

Message log

GEThttps://bcmagency.net/wp-json/wpbcm/v1/messages

List sent and received messages with their delivery status.

ParameterRequiredDescription
directionNoin | out
statusNopending | sent | delivered | read | failed | received
phoneNoFilter by phone.
page / per_pageNo1 / 20 (max 100)
curl -X GET "https://bcmagency.net/wp-json/wpbcm/v1/messages" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/messages');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/messages', {
  method: 'GET',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: GET
URL: https://bcmagency.net/wp-json/wpbcm/v1/messages
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

Send an OTP code

POSThttps://bcmagency.net/wp-json/wpbcm/v1/otp/send

Generates a secure one-time code and sends it on WhatsApp. The code is never returned by the API.

ParameterRequiredDescription
phoneYesRecipient in international format, e.g. 201001234567 (or a group JID).
lengthNo4 – 8 (default 6)
expiryNoMinutes, 1 – 60 (default 5).
messageNoCustom text containing {{code}} and {{minutes}}.
curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/otp/send" \
  -H "token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "201001234567",
    "length": 6,
    "expiry": 5
}'
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/otp/send');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'phone' => '201001234567',
        'length' => 6,
        'expiry' => 5
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/otp/send', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({
      "phone": "201001234567",
      "length": 6,
      "expiry": 5
  }),
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/otp/send
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN
Send Body: ON → JSON
{
    "phone": "201001234567",
    "length": 6,
    "expiry": 5
}

Response

{
    "success": true,
    "message": "Verification code sent.",
    "data": {
        "otp_id": 77,
        "phone": "201001234567",
        "expires_in": 300
    }
}

Verify an OTP code

POSThttps://bcmagency.net/wp-json/wpbcm/v1/otp/verify

Returns valid=true when the code is correct. Codes expire and allow 5 attempts.

ParameterRequiredDescription
phoneYesThe phone the code was sent to (or otp_id).
codeYes123456
curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/otp/verify" \
  -H "token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "201001234567",
    "code": "123456"
}'
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/otp/verify');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'phone' => '201001234567',
        'code' => '123456'
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/otp/verify', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({
      "phone": "201001234567",
      "code": "123456"
  }),
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/otp/verify
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN
Send Body: ON → JSON
{
    "phone": "201001234567",
    "code": "123456"
}

Response

{
    "success": true,
    "valid": true,
    "reason": "verified"
}

Create a bulk campaign

POSThttps://bcmagency.net/wp-json/wpbcm/v1/campaigns

Send to many numbers with random delays between messages. Start now, schedule, or keep as draft.

ParameterRequiredDescription
instance_idsYesArray of instance IDs (messages are distributed round-robin).
messageYesDefault text with {{variables}}.
messagesNoArray of rows: {"phone_number":"2010…","vars":{"name":"Amr"}}.
numbersNoAlternative: text with one number per line.
group_idsNoContact group IDs.
media_urlNoOptional media URL.
wait_min / wait_maxNoRandom delay between messages in seconds (default 5 – 15).
start_nowNotrue | false
schedule_isoNo2026-10-05T09:00:00+02:00
curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/campaigns" \
  -H "token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "October offer",
    "instance_ids": [
        "ins_xxxxxxxx"
    ],
    "message": "Hi {{name|there}}, enjoy 20% off today!",
    "messages": [
        {
            "phone_number": "201001234567",
            "vars": {
                "name": "Amr"
            }
        },
        {
            "phone_number": "201009876543"
        }
    ],
    "wait_min": 5,
    "wait_max": 15,
    "start_now": true
}'
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/campaigns');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'name' => 'October offer',
        'instance_ids' => [
            'ins_xxxxxxxx'
        ],
        'message' => 'Hi {{name|there}}, enjoy 20% off today!',
        'messages' => [
            [
                'phone_number' => '201001234567',
                'vars' => [
                    'name' => 'Amr'
                ]
            ],
            [
                'phone_number' => '201009876543'
            ]
        ],
        'wait_min' => 5,
        'wait_max' => 15,
        'start_now' => true
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/campaigns', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({
      "name": "October offer",
      "instance_ids": [
          "ins_xxxxxxxx"
      ],
      "message": "Hi {{name|there}}, enjoy 20% off today!",
      "messages": [
          {
              "phone_number": "201001234567",
              "vars": {
                  "name": "Amr"
              }
          },
          {
              "phone_number": "201009876543"
          }
      ],
      "wait_min": 5,
      "wait_max": 15,
      "start_now": true
  }),
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/campaigns
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN
Send Body: ON → JSON
{
    "name": "October offer",
    "instance_ids": [
        "ins_xxxxxxxx"
    ],
    "message": "Hi {{name|there}}, enjoy 20% off today!",
    "messages": [
        {
            "phone_number": "201001234567",
            "vars": {
                "name": "Amr"
            }
        },
        {
            "phone_number": "201009876543"
        }
    ],
    "wait_min": 5,
    "wait_max": 15,
    "start_now": true
}

List campaigns

GEThttps://bcmagency.net/wp-json/wpbcm/v1/campaigns

Campaigns with progress counters.

ParameterRequiredDescription
statusNodraft | scheduled | running | paused | completed | cancelled
curl -X GET "https://bcmagency.net/wp-json/wpbcm/v1/campaigns" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/campaigns');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/campaigns', {
  method: 'GET',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: GET
URL: https://bcmagency.net/wp-json/wpbcm/v1/campaigns
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

Start / pause / resume / cancel

POSThttps://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/start

Replace start with pause, resume or cancel.

curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/start" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/start');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/start', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/start
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

Campaign recipients

GEThttps://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/messages

Status of every recipient of the campaign.

curl -X GET "https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/messages" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/messages');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/messages', {
  method: 'GET',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: GET
URL: https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/messages
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

Retry the failed recipients

POSThttps://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/retry

Creates and starts a new campaign with the same content for the numbers that failed.

curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/retry" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/retry');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/retry', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/campaigns/{id}/retry
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

List blocked numbers

GEThttps://bcmagency.net/wp-json/wpbcm/v1/blocklist

Numbers that unsubscribed (opt-out keyword) or were blocked. Campaigns skip them automatically.

ParameterRequiredDescription
searchNoFilter by phone.
page / per_pageNo1 / 30 (max 100)
curl -X GET "https://bcmagency.net/wp-json/wpbcm/v1/blocklist" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/blocklist');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/blocklist', {
  method: 'GET',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: GET
URL: https://bcmagency.net/wp-json/wpbcm/v1/blocklist
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

Block numbers

POSThttps://bcmagency.net/wp-json/wpbcm/v1/blocklist

Add one number (phone) or many (phones). Use it when a customer unsubscribes in your own system.

ParameterRequiredDescription
phoneNo201001234567
phonesNo["201001234567","201009876543"]
curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/blocklist" \
  -H "token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phones": [
        "201001234567",
        "201009876543"
    ]
}'
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/blocklist');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'phones' => [
            '201001234567',
            '201009876543'
        ]
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/blocklist', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({
      "phones": [
          "201001234567",
          "201009876543"
      ]
  }),
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/blocklist
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN
Send Body: ON → JSON
{
    "phones": [
        "201001234567",
        "201009876543"
    ]
}

Response

{
    "success": true,
    "message": "2 numbers added to the blocklist.",
    "added": 2
}

Unblock a number

DELETEhttps://bcmagency.net/wp-json/wpbcm/v1/blocklist/{id}

Remove an entry by its ID from GET /blocklist.

curl -X DELETE "https://bcmagency.net/wp-json/wpbcm/v1/blocklist/{id}" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/blocklist/{id}');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/blocklist/{id}', {
  method: 'DELETE',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: DELETE
URL: https://bcmagency.net/wp-json/wpbcm/v1/blocklist/{id}
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

Create / update contacts

POSThttps://bcmagency.net/wp-json/wpbcm/v1/contacts

Upsert by phone. Send one contact or an array in "contacts".

ParameterRequiredDescription
phoneYes201001234567
nameNoAhmed
emailNoahmed@example.com
group_idsNo[1,2]
fieldsNoCustom fields usable as {{variables}}.
curl -X POST "https://bcmagency.net/wp-json/wpbcm/v1/contacts" \
  -H "token: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "201001234567",
    "name": "Ahmed",
    "group_ids": [
        1
    ],
    "fields": {
        "city": "Cairo"
    }
}'
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/contacts');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'phone' => '201001234567',
        'name' => 'Ahmed',
        'group_ids' => [
            1
        ],
        'fields' => [
            'city' => 'Cairo'
        ]
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/contacts', {
  method: 'POST',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({
      "phone": "201001234567",
      "name": "Ahmed",
      "group_ids": [
          1
      ],
      "fields": {
          "city": "Cairo"
      }
  }),
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: POST
URL: https://bcmagency.net/wp-json/wpbcm/v1/contacts
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN
Send Body: ON → JSON
{
    "phone": "201001234567",
    "name": "Ahmed",
    "group_ids": [
        1
    ],
    "fields": {
        "city": "Cairo"
    }
}

List contacts

GEThttps://bcmagency.net/wp-json/wpbcm/v1/contacts

Search and paginate contacts.

ParameterRequiredDescription
searchNoName, phone or email.
group_idNo1
curl -X GET "https://bcmagency.net/wp-json/wpbcm/v1/contacts" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/contacts');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/contacts', {
  method: 'GET',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: GET
URL: https://bcmagency.net/wp-json/wpbcm/v1/contacts
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

List contact groups

GEThttps://bcmagency.net/wp-json/wpbcm/v1/groups

Groups with contact counts.

curl -X GET "https://bcmagency.net/wp-json/wpbcm/v1/groups" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/groups');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/groups', {
  method: 'GET',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: GET
URL: https://bcmagency.net/wp-json/wpbcm/v1/groups
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

List message templates

GEThttps://bcmagency.net/wp-json/wpbcm/v1/templates

Your saved templates.

curl -X GET "https://bcmagency.net/wp-json/wpbcm/v1/templates" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/templates');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/templates', {
  method: 'GET',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: GET
URL: https://bcmagency.net/wp-json/wpbcm/v1/templates
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

List WhatsApp numbers

GEThttps://bcmagency.net/wp-json/wpbcm/v1/instances

All instances with their connection status.

curl -X GET "https://bcmagency.net/wp-json/wpbcm/v1/instances" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/instances');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/instances', {
  method: 'GET',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: GET
URL: https://bcmagency.net/wp-json/wpbcm/v1/instances
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

Response

{
    "success": true,
    "instances": [
        {
            "id": "ins_xxx",
            "name": "Sales",
            "driver": "gateway",
            "status": "connected",
            "phone": "201001234567"
        }
    ]
}

Live instance status

GEThttps://bcmagency.net/wp-json/wpbcm/v1/instances/{instance_id}/status

Refreshes the connection state from WhatsApp.

curl -X GET "https://bcmagency.net/wp-json/wpbcm/v1/instances/ins_xxxxxxxx/status" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/instances/ins_xxxxxxxx/status');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/instances/ins_xxxxxxxx/status', {
  method: 'GET',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: GET
URL: https://bcmagency.net/wp-json/wpbcm/v1/instances/ins_xxxxxxxx/status
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

Account, plan & usage

GEThttps://bcmagency.net/wp-json/wpbcm/v1/account

Subscription status, limits and usage counters.

curl -X GET "https://bcmagency.net/wp-json/wpbcm/v1/account" \
  -H "token: YOUR_API_TOKEN"
<?php
$ch = curl_init('https://bcmagency.net/wp-json/wpbcm/v1/account');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => ['token: YOUR_API_TOKEN', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
const res = await fetch('https://bcmagency.net/wp-json/wpbcm/v1/account', {
  method: 'GET',
  headers: { 'token': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' },
});
const data = await res.json();
console.log(data);
Node: HTTP Request
Method: GET
URL: https://bcmagency.net/wp-json/wpbcm/v1/account
Authentication: None
Send Headers: ON
  • token = YOUR_API_TOKEN

Webhooks

Add a webhook URL in the dashboard and choose the events. We POST a JSON payload for every event and sign it with your webhook secret (HMAC-SHA256) in the X-WPBCM-Signature header.

EventDescription
message.receivedIncoming message
message.sentMessage sent
message.failedMessage failed
message.statusDelivery / read status
instance.statusNumber connected / disconnected
campaign.completedCampaign completed
otp.verifiedOTP verified

Payload example

{
    "event": "message.received",
    "webhook_id": 4,
    "timestamp": 1790000000,
    "data": {
        "id": 2051,
        "instance_id": "ins_xxxxxxxx",
        "direction": "in",
        "phone": "201001234567",
        "contact_name": "Ahmed",
        "type": "text",
        "body": "Hello",
        "status": "received",
        "is_group": false
    }
}

Verify the signature

$payload   = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_WPBCM_SIGNATURE'] ?? '';
$expected  = 'sha256=' . hash_hmac('sha256', $payload, 'YOUR_WEBHOOK_SECRET');
if (!hash_equals($expected, $signature)) { http_response_code(401); exit; }
$event = json_decode($payload, true);
// $event['event'], $event['data']['phone'], $event['data']['body'] ...
http_response_code(200);
const crypto = require('crypto');
app.post('/whatsapp-webhook', express.raw({ type: 'application/json' }), (req, res) => {
  const expected = 'sha256=' + crypto.createHmac('sha256', 'YOUR_WEBHOOK_SECRET').update(req.body).digest('hex');
  if (req.get('X-WPBCM-Signature') !== expected) return res.sendStatus(401);
  const event = JSON.parse(req.body);
  console.log(event.event, event.data);
  res.sendStatus(200);
});

WooCommerce

  1. In the dashboard open Integrations → WooCommerce, choose the number and write a message for each order status.
  2. Copy your private integration URL.
  3. In your store go to WooCommerce → Settings → Advanced → Webhooks → Add webhook. Topic: "Order created" (and a second one for "Order updated"), Delivery URL: your integration URL, Secret: the same secret you saved in the integration (optional).
  4. Save. Customers now receive WhatsApp messages automatically with variables like {{first_name}}, {{order_number}}, {{total}}, {{status}} and {{items}}.

EasyOrders

  1. In the dashboard open Integrations → EasyOrders and create the integration.
  2. Copy the integration URL and add it as a webhook in your EasyOrders store settings (order created / order status changed).
  3. The customer phone, name, order number, total and status are detected automatically. If your payload uses another field for the phone, set its path (e.g. customer.phone).

n8n

  1. Add an "HTTP Request" node, method POST, URL: the endpoint you need (e.g. /send-message).
  2. Enable "Send Headers" and add a header named token with your API key.
  3. Enable "Send Body" (JSON) with phone and message — you can map values from previous nodes.
  4. To react to incoming messages, add a "Webhook" trigger node in n8n and paste its URL in the dashboard → Webhooks.

SDKs & downloads