Skip to content

REST API v1

Hello PBX API reference

Base URL
https://pbx.itfair.bd/api
Format
HTTPS · JSON
Updated

Overview

এপিআই দিয়ে কল, ভয়েস ওটিপি, কল হিস্ট্রি ও ওয়েবহুক আপনার সফটওয়্যারে যুক্ত করুন।

The Hello PBX API lets your software place calls, send voice OTP, run order-confirmation calls, read call records and recordings, and keep CRM and PBX settings in sync. All requests use HTTPS and JSON. New endpoints live under /api/v1; some older endpoints are still unversioned and are listed exactly as they are.

Step 1

Get a plan with API access

Developer API Access; Voice OTP and auto calls need Auto Call API & Voice OTP.

Step 2

Create a token

Panel → API Keys. Pick only the abilities your code needs.

Step 3

Call GET /api/v1/ping

A “pong” reply means you are connected.

Authentication

প্রতিটি রিকোয়েস্টে Bearer টোকেন পাঠান।

Send your token in the Authorization header. Tokens expire after 90 days. Keep them on your server — never in a mobile app or browser code.

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

Abilities

Each endpoint below shows the ability it needs. A token can only get abilities its creator’s role allows (owner/admin: all; supervisor, agent and viewer: fewer).

pbx:readpbx:writecrm:readcrm:writecampaigns:readcampaigns:writecalls:readcalls:writeotp:sendotp:verifybilling:readwebhooks:readwebhooks:writetokens:readtokens:writeagents:readagents:writebroadcast:readbroadcast:write

Rate limits

সীমা পার হলে 429 আসে; Retry-After হেডার দেখে আবার চেষ্টা করুন।

Rate limits
ScopeLimit
All authenticated endpoints120 requests / minute per token user
POST /api/v1/otp/send60 / minute per account, 10 / day per destination number
POST /api/v1/otp/verify300 / minute per account
Auto calls and originate60 / minute per account, 5 / day per destination number

Errors

ভুল হলে HTTP স্ট্যাটাস ও JSON বডিতে কারণ থাকে।

Validation errors (422) list each field; other errors carry a short machine code in error.

{"message": "The phone number field format is invalid.",
 "errors": {"phone_number": ["The phone number field format is invalid."]}}

{"status": "error", "error": "insufficient_balance"}
HTTP status codes
CodeMeaningWhat to do
401UnauthenticatedToken missing, wrong or expired. Tokens last 90 days; create a new one in the panel.
403ForbiddenThe token lacks the ability for this endpoint, or your plan does not include the feature.
404Not foundThe id does not exist or belongs to another account.
422Validation failedThe response body lists each invalid field under "errors".
429Too many requestsYou hit a rate limit. Wait for the time in the Retry-After header.
402Insufficient balanceRecharge your wallet before placing more calls.
409 · 410 · 423OTP stateAlready verified · expired · locked after 5 wrong codes.
503Telephony unavailableThe call server could not be reached. Retry later.

Idempotency

একই কী দিয়ে আবার পাঠালে দ্বিতীয় কল হয় না।

Endpoints that place a call (POST /api/v1/otp/send, POST /api/v1/auto-calls, POST /api/v1/calls/verify, POST /api/v1/calls/originate) accept an Idempotency-Key header (max 100 characters). Sending the same key again within 24 hours returns the first response with the header Idempotency-Replayed: true and never places a second call — use your order id.

  • Same key, different request body → 422.
  • Same key while the first request is still running → 409; retry a moment later.
  • Server errors (5xx) are not stored, so you can safely retry with the same key.

Coming from hellopbx.bd?

Order verification works with the same field names at POST /api/v1/calls/verify. Change the base URL to https://pbx.itfair.bd/api/v1 and use a Hello PBX token. Build your “Press 1 / Press 2” IVR once in the panel (IVR Builder → Order confirmation template).

Voice OTP

ফোন কলে ওটিপি কোড পাঠান ও যাচাই করুন।

Call a phone number and read a one-time code digit by digit, then verify what the user typed. Calls go out through your own SIP trunk / IP number; the carrier bills that line. Each code is stored hashed and expires after ttl_minutes.

Plan feature: Auto Call API & Voice OTP

Send an OTP by voice call #

POST /api/v1/otp/send

Ability: otp:send Limit: 60 / minute per account · per-destination daily cap Idempotency-Key supported

Creates an OTP and places the call. If you omit code, a code is generated and returned in the response so your app can show or compare it. The call plays: intro → digits → repeat → digits → outro. Intro, repeat and outro are your own recordings (Panel → Voice OTP → Audio, where each file shows its id); the file must be yours, of the same type and language, and synced. If you have no file of a type, that part is skipped. If the number is busy or does not answer, we call again after 30 seconds while the code is valid (up to 3 calls); otp.failed is sent only after the last call.

Send an OTP by voice call parameters
ParameterTypeDescription
phone_number required · body string Number to call.6–15 digits, optional leading +
code optional · body string Your own code. Omit to let us generate one.4–8 digits
ttl_minutes optional · body integer How long the code stays valid.1–30, default 10
language optional · body string Language of the digits and of your intro/repeat/outro audio.bn or en, default bn
intro_id optional · body string Intro played before the digits. Omit to use your default intro for this language; none skips it.file id or "none"
repeat_id optional · body string Played between the first and second reading of the digits. Omit for your default; none skips it.file id or "none"
outro_id optional · body string Played after the digits. Omit for your default; none skips it.file id or "none"
  • 403Token lacks otp:send, or plan has no Voice OTP
  • 422Invalid phone number, code, ttl or language; or the selected intro/repeat/outro audio is not available for this language
  • 429Rate limit or daily cap for this number reached

code is present only when you did not send one.

curl -X POST "https://pbx.itfair.bd/api/v1/otp/send" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "phone_number": "01712345678",
      "code": "4821",
      "ttl_minutes": 5,
      "language": "bn",
      "intro_id": "12",
      "repeat_id": "none",
      "outro_id": "15"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/v1/otp/send', [
        'phone_number' => '01712345678',
        'code' => '4821',
        'ttl_minutes' => 5,
        'language' => 'bn',
        'intro_id' => '12',
        'repeat_id' => 'none',
        'outro_id' => '15',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/otp/send', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "phone_number": "01712345678",
      "code": "4821",
      "ttl_minutes": 5,
      "language": "bn",
      "intro_id": "12",
      "repeat_id": "none",
      "outro_id": "15"
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/v1/otp/send",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"phone_number":"01712345678","code":"4821","ttl_minutes":5,"language":"bn","intro_id":"12","repeat_id":"none","outro_id":"15"},
)
data = res.json()

Response 201

{
    "status": "dispatched",
    "otp_id": 1234,
    "phone_number": "01712345678",
    "expires_at": "2026-09-27T10:05:00+06:00",
    "code": "482193"
}

Verify the code the user entered #

POST /api/v1/otp/verify

Ability: otp:verify Limit: 300 / minute per account

Compares the code in constant time. Five wrong attempts lock the OTP; you then need a new one.

Verify the code the user entered parameters
ParameterTypeDescription
otp_id required · body integer The OTP to check.from the send response
code required · body string What the user typed.max 10 characters
  • 404{"error":"OTP request not found."}
  • 409already_verified
  • 410expired
  • 422invalid_code (attempt counted)
  • 423locked — 5 wrong attempts
curl -X POST "https://pbx.itfair.bd/api/v1/otp/verify" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "otp_id": 1234,
      "code": "482193"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/v1/otp/verify', [
        'otp_id' => 1234,
        'code' => '482193',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/otp/verify', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "otp_id": 1234,
      "code": "482193"
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/v1/otp/verify",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"otp_id":1234,"code":"482193"},
)
data = res.json()

Response 200

{
    "status": "verified",
    "otp_id": 1234,
    "phone_number": "01712345678",
    "verified_at": "2026-09-27T10:02:11+06:00"
}

Get OTP status #

GET /api/v1/otp/{id}

Ability: otp:send

Status is one of queued, calling, delivered, failed, verified, expired, locked.

Get OTP status parameters
ParameterTypeDescription
id required · path integer OTP id.
  • 404Not found or belongs to another account
curl -X GET "https://pbx.itfair.bd/api/v1/otp/1234" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/v1/otp/1234');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/otp/1234', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/v1/otp/1234",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

{
    "otp_id": 1234,
    "phone_number": "01712345678",
    "status": "delivered",
    "expires_at": "2026-09-27T10:05:00+06:00",
    "verified_at": null,
    "created_at": "2026-09-27T10:00:00+06:00"
}

Calls

ক্লিক-টু-কল, কল হিস্ট্রি (CDR) ও রেকর্ডিং।

Start calls from your CRM, read call detail records and download recordings.

Plan feature: Developer API Access

Click-to-call #

POST /api/v1/calls/originate

Ability: calls:write Limit: 60 / minute per account Idempotency-Key supported

Rings your agent’s extension first; when the agent answers, the customer’s number is dialled and the two are connected. Numbers on your DNC list are refused. The call is queued and placed within a few seconds; attempt_id identifies it.

Click-to-call parameters
ParameterTypeDescription
extension required · body string Agent extension to ring first.2–8 digits, an active extension
phone_number required · body string Customer number.6–15 digits
caller_id optional · body string Number shown to the customer.one of your active numbers
  • 402insufficient_balance
  • 422extension_not_found · number_on_dnc_list
  • 503telephony_unavailable
curl -X POST "https://pbx.itfair.bd/api/v1/calls/originate" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "extension": "101",
      "phone_number": "01712345678",
      "caller_id": "09639000000"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/v1/calls/originate', [
        'extension' => '101',
        'phone_number' => '01712345678',
        'caller_id' => '09639000000',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/calls/originate', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "extension": "101",
      "phone_number": "01712345678",
      "caller_id": "09639000000"
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/v1/calls/originate",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"extension":"101","phone_number":"01712345678","caller_id":"09639000000"},
)
data = res.json()

Response 200

{
    "status": "success",
    "message": "Call originated successfully. Ringing extension 101 first.",
    "channel": "PJSIP/12_101",
    "destination": "01712345678",
    "attempt_id": "9b2f6c1e-4d7a-4f43-9c1a-2e8f5b7d3a10"
}

Call history (CDR) #

GET /api/v1/calls/history

Ability: calls:read

Paginated call detail records, newest first.

Call history (CDR) parameters
ParameterTypeDescription
start_date optional · query date From this day.Y-m-d
end_date optional · query date Up to this day.Y-m-d
phone optional · query string Part of the caller or dialled number.max 20 (alias `dst`)
extension optional · query string Exact source extension/number.max 20 (alias `src`)
disposition optional · query string Call result.ANSWERED | NO ANSWER | BUSY | FAILED
direction optional · query string Direction.inbound | outbound | internal
per_page optional · query integer Page size.1–100, default 25
curl -X GET "https://pbx.itfair.bd/api/v1/calls/history?start_date=2026-09-01&end_date=2026-09-27&per_page=25" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/v1/calls/history', [
        'start_date' => '2026-09-01',
        'end_date' => '2026-09-27',
        'per_page' => 25,
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/calls/history?start_date=2026-09-01&end_date=2026-09-27&per_page=25', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/v1/calls/history",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    params={"start_date":"2026-09-01","end_date":"2026-09-27","per_page":25},
)
data = res.json()

Response 200

{
    "status": "success",
    "data": [
        {
            "id": 88120,
            "uniqueid": "1727430000.42",
            "call_date": "2026-09-27 10:14:03",
            "direction": "outbound",
            "source": "101",
            "destination": "01712345678",
            "duration": 74,
            "billsec": 61,
            "disposition": "ANSWERED",
            "cost": 0.46,
            "has_recording": true,
            "recording_url": "https://example.com/api/v1/calls/recordings/1727430000.42"
        }
    ],
    "pagination": {
        "current_page": 1,
        "last_page": 12,
        "per_page": 25,
        "total": 290
    }
}

Download a call recording #

GET /api/v1/calls/recordings/{uniqueid}

Ability: calls:read Plan: Call Recording

Returns the WAV file (audio/wav). Use recording_url from call history.

Download a call recording parameters
ParameterTypeDescription
uniqueid required · path string Call uniqueid.letters, digits, dot, dash
  • 404No recording for this call, or the file is no longer stored
curl -X GET "https://pbx.itfair.bd/api/v1/calls/recordings/1727430000.42" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/v1/calls/recordings/1727430000.42');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/calls/recordings/1727430000.42', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/v1/calls/recordings/1727430000.42",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

binary audio/wav

List calls (raw records) #

GET /api/calls

Ability: calls:read

Paginated call records with all stored fields.

curl -X GET "https://pbx.itfair.bd/api/calls" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/calls');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/calls', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/calls",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

{
    "data": [
        "…"
    ],
    "current_page": 1
}

Set disposition and notes on a call #

PUT /api/calls/{call}

Ability: calls:write

Set disposition and notes on a call parameters
ParameterTypeDescription
call required · path integer Call id.
agent_disposition_id optional · body integer Outcome picked by the agent.a disposition id
agent_notes optional · body string Free-text notes.
curl -X PUT "https://pbx.itfair.bd/api/calls/88120" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "agent_disposition_id": 3,
      "agent_notes": "Customer will call back tomorrow"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->put('https://pbx.itfair.bd/api/calls/88120', [
        'agent_disposition_id' => 3,
        'agent_notes' => 'Customer will call back tomorrow',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/calls/88120', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "agent_disposition_id": 3,
      "agent_notes": "Customer will call back tomorrow"
  }),
});
const data = await res.json();
import requests

res = requests.put(
    "https://pbx.itfair.bd/api/calls/88120",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"agent_disposition_id":3,"agent_notes":"Customer will call back tomorrow"},
)
data = res.json()

Response 200

{
    "id": 88120,
    "agent_disposition_id": 3,
    "agent_notes": "Customer will call back tomorrow"
}

Auto calls (order confirmation)

অটো কল — অর্ডার কনফার্মেশন ও সার্ভে।

Place an automated call that plays one of your IVRs (e.g. “Press 1 to confirm, 2 to cancel”) and get the key press back by webhook. Build order-confirmation IVRs in the panel’s IVR Builder (“Order confirmation template”).

Plan feature: Auto Call API & Voice OTP

Create an auto call #

POST /api/v1/auto-calls

Ability: calls Limit: 60 / minute per account · 5 / day per number Idempotency-Key supported

Queues the call and returns immediately. The result arrives as auto_call.completed (to your webhook endpoints and, if given, to webhook_url).

Create an auto call parameters
ParameterTypeDescription
Idempotency-Key optional · header string Repeat-safe: the same key never creates a second call.max 100 chars
to required · body string Customer number.6–15 digits
ivr_id required · body integer IVR to play.your active IVR
caller_id optional · body string Number shown to the customer.one of your active numbers
agent_extension optional · body string Extension used by a “talk to agent” option on this call.2–8 digits
metadata optional · body object Returned untouched in every related webhook.max 2 KB
webhook_url optional · body url Per-call callback.HTTPS, public host
max_attempts optional · body integer Redials when not answered.1–3
retry_after_minutes optional · body integer Wait between attempts.1–120
  • 402insufficient_balance
  • 422Invalid field, metadata over 2 KB, or unsafe webhook_url
curl -X POST "https://pbx.itfair.bd/api/v1/auto-calls" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Idempotency-Key: order-10045" \
  -H "Content-Type: application/json" \
  -d '{
      "to": "01712345678",
      "ivr_id": 7,
      "metadata": {
          "order_id": "WC-10045",
          "amount": "1250"
      },
      "webhook_url": "https://shop.example.com/hooks/hellopbx",
      "max_attempts": 2
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->withHeaders([
        'Idempotency-Key' => 'order-10045',
    ])
    ->post('https://pbx.itfair.bd/api/v1/auto-calls', [
        'to' => '01712345678',
        'ivr_id' => 7,
        'metadata' => [
            'order_id' => 'WC-10045',
            'amount' => '1250',
        ],
        'webhook_url' => 'https://shop.example.com/hooks/hellopbx',
        'max_attempts' => 2,
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/auto-calls', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
    'Idempotency-Key': 'order-10045',
  },
  body: JSON.stringify({
      "to": "01712345678",
      "ivr_id": 7,
      "metadata": {
          "order_id": "WC-10045",
          "amount": "1250"
      },
      "webhook_url": "https://shop.example.com/hooks/hellopbx",
      "max_attempts": 2
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/v1/auto-calls",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json", "Idempotency-Key": "order-10045"},
    json={"to":"01712345678","ivr_id":7,"metadata":{"order_id":"WC-10045","amount":"1250"},"webhook_url":"https://shop.example.com/hooks/hellopbx","max_attempts":2},
)
data = res.json()

Response 202

{
    "auto_call_id": 551,
    "status": "queued"
}

Get an auto call and its result #

GET /api/v1/auto-calls/{id}

Ability: calls

status: queued, calling, answered_with_input, answered_no_input, no_answer, busy, failed.

Get an auto call and its result parameters
ParameterTypeDescription
id required · path integer Auto call id.
curl -X GET "https://pbx.itfair.bd/api/v1/auto-calls/551" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/v1/auto-calls/551');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/auto-calls/551', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/v1/auto-calls/551",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

{
    "auto_call_id": 551,
    "to": "01712345678",
    "ivr_id": 7,
    "status": "answered_with_input",
    "attempts": 1,
    "digits_pressed": "1",
    "option_value": "confirmed",
    "option_label": "Order confirmed",
    "duration": 18,
    "call_id": 88121,
    "metadata": {
        "order_id": "WC-10045"
    },
    "completed_at": "2026-09-27T10:20:40+06:00",
    "created_at": "2026-09-27T10:20:00+06:00"
}

hellopbx.bd-compatible order verification hellopbx-compatible #

POST /api/v1/calls/verify

Ability: calls Idempotency-Key supported

Same engine as auto calls, with hellopbx.bd field names, so an existing integration only changes the base URL and token. Uses ivr_id or your default order-confirmation IVR (Voice Settings).

hellopbx.bd-compatible order verification parameters
ParameterTypeDescription
phone_number required · body string Customer number (→ to).6–15 digits
webhook_url required · body url Where the result is sent.HTTPS, public host
ivr_id optional · body integer Which order-confirmation IVR to play.default: your order IVR
caller_id optional · body string Caller ID.
agent_extension optional · body string For “talk to agent”.2–8 digits
order_id optional · body string Stored in metadata, echoed in the callback.max 100
customer_name optional · body string Stored in metadata.max 100
amount optional · body string Stored in metadata.max 50
store_name optional · body string Stored in metadata.max 100
  • 422order_confirmation_ivr_not_set — pass ivr_id or set a default

TTS fields (custom_text, confirm_text, cancel_text, *_audio_url) are accepted but ignored for now; the response then lists "tts_fields_ignored" in warnings. Callback status: confirmed, rejected, the pressed option’s value, No Response, BUSY, NOANSWER.

curl -X POST "https://pbx.itfair.bd/api/v1/calls/verify" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "phone_number": "01712345678",
      "webhook_url": "https://shop.example.com/hooks/verify",
      "order_id": "WC-10045",
      "amount": "1250"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/v1/calls/verify', [
        'phone_number' => '01712345678',
        'webhook_url' => 'https://shop.example.com/hooks/verify',
        'order_id' => 'WC-10045',
        'amount' => '1250',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/calls/verify', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "phone_number": "01712345678",
      "webhook_url": "https://shop.example.com/hooks/verify",
      "order_id": "WC-10045",
      "amount": "1250"
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/v1/calls/verify",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"phone_number":"01712345678","webhook_url":"https://shop.example.com/hooks/verify","order_id":"WC-10045","amount":"1250"},
)
data = res.json()

Response 202

{
    "status": "success",
    "call_id": 551,
    "warnings": []
}

Account & wallet

টোকেন যাচাই ও ওয়ালেট ব্যালেন্স।

Check your token and read your wallet balance.

Plan feature: Developer API Access

Check your token #

GET /api/v1/ping

Ability: any

Returns pong when the token is valid.

curl -X GET "https://pbx.itfair.bd/api/v1/ping" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/v1/ping');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/ping', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/v1/ping",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

{
    "status": "success",
    "message": "pong",
    "tenant_id": 12
}

Wallet balance #

GET /api/v1/balance/global

Ability: billing:read

Available prepaid balance in BDT.

curl -X GET "https://pbx.itfair.bd/api/v1/balance/global" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/v1/balance/global');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/v1/balance/global', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/v1/balance/global",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

{
    "status": "success",
    "balance": 1540.75,
    "currency": "BDT",
    "tenant": "Shop BD"
}

Webhook endpoints

ওয়েবহুক ইউআরএল তৈরি ও পরিচালনা।

Register the URLs that receive events (see Webhooks below). The number of endpoints is limited by your plan.

Plan feature: Developer API Access

List endpoints #

GET /api/webhook-endpoints

Ability: webhooks:read

curl -X GET "https://pbx.itfair.bd/api/webhook-endpoints" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/webhook-endpoints');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/webhook-endpoints', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/webhook-endpoints",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

[
    {
        "id": 3,
        "url": "https://shop.example.com/hooks/hellopbx",
        "events": [
            "otp.verified",
            "auto_call.completed"
        ],
        "is_active": true
    }
]

Create an endpoint #

POST /api/webhook-endpoints

Ability: webhooks:write

The response includes the signing secret — store it to verify signatures.

Create an endpoint parameters
ParameterTypeDescription
url required · body url Receiver URL.max 255, public host
events optional · body array Empty = all events.event names or ["*"]
is_active optional · body boolean Pause without deleting.
  • 422plan_limit_reached or unsafe URL
curl -X POST "https://pbx.itfair.bd/api/webhook-endpoints" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "url": "https://shop.example.com/hooks/hellopbx",
      "events": [
          "otp.verified",
          "auto_call.completed"
      ],
      "is_active": true
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/webhook-endpoints', [
        'url' => 'https://shop.example.com/hooks/hellopbx',
        'events' => [
            'otp.verified',
            'auto_call.completed',
        ],
        'is_active' => true,
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/webhook-endpoints', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "url": "https://shop.example.com/hooks/hellopbx",
      "events": [
          "otp.verified",
          "auto_call.completed"
      ],
      "is_active": true
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/webhook-endpoints",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"url":"https://shop.example.com/hooks/hellopbx","events":["otp.verified","auto_call.completed"],"is_active":True},
)
data = res.json()

Response 201

{
    "id": 3,
    "url": "https://shop.example.com/hooks/hellopbx",
    "events": [
        "otp.verified"
    ],
    "is_active": true,
    "secret": "32-character signing secret"
}

Get an endpoint #

GET /api/webhook-endpoints/{webhook_endpoint}

Ability: webhooks:read

Get an endpoint parameters
ParameterTypeDescription
webhook_endpoint required · path integer Endpoint id.
curl -X GET "https://pbx.itfair.bd/api/webhook-endpoints/3" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/webhook-endpoints/3');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/webhook-endpoints/3', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/webhook-endpoints/3",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

{
    "id": 3,
    "url": "…"
}

Update an endpoint #

PUT /api/webhook-endpoints/{webhook_endpoint}

Ability: webhooks:write

Update an endpoint parameters
ParameterTypeDescription
webhook_endpoint required · path integer Endpoint id.
is_active optional · body boolean Also accepts url, events.
curl -X PUT "https://pbx.itfair.bd/api/webhook-endpoints/3" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "is_active": false
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->put('https://pbx.itfair.bd/api/webhook-endpoints/3', [
        'is_active' => false,
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/webhook-endpoints/3', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "is_active": false
  }),
});
const data = await res.json();
import requests

res = requests.put(
    "https://pbx.itfair.bd/api/webhook-endpoints/3",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"is_active":False},
)
data = res.json()

Response 200

{
    "id": 3,
    "is_active": false
}

Delete an endpoint #

DELETE /api/webhook-endpoints/{webhook_endpoint}

Ability: webhooks:write

Delete an endpoint parameters
ParameterTypeDescription
webhook_endpoint required · path integer Endpoint id.
curl -X DELETE "https://pbx.itfair.bd/api/webhook-endpoints/3" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->delete('https://pbx.itfair.bd/api/webhook-endpoints/3');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/webhook-endpoints/3', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.delete(
    "https://pbx.itfair.bd/api/webhook-endpoints/3",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 204

(empty body)

CRM contacts

কন্টাক্ট, স্ক্রিন-পপ ও কল টাইমলাইন।

Keep contacts in sync with your system and look callers up by number.

Plan feature: Developer API Access

Find a contact by phone (screen pop) #

GET /api/contacts/lookup

Ability: crm:read

Find a contact by phone (screen pop) parameters
ParameterTypeDescription
phone required · query string Caller number.
  • 404{"message":"Contact not found"}
curl -X GET "https://pbx.itfair.bd/api/contacts/lookup?phone=01712345678" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/contacts/lookup', [
        'phone' => '01712345678',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/contacts/lookup?phone=01712345678', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/contacts/lookup",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    params={"phone":"01712345678"},
)
data = res.json()

Response 200

{
    "id": 41,
    "first_name": "Karim",
    "phone_number": "01712345678"
}

List contacts #

GET /api/contacts

Ability: crm:read

curl -X GET "https://pbx.itfair.bd/api/contacts" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/contacts');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/contacts', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/contacts",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

{
    "data": [
        "…"
    ]
}

Create a contact #

POST /api/contacts

Ability: crm:write

Create a contact parameters
ParameterTypeDescription
first_name required · body string
last_name optional · body string
phone_number required · body string max 50, unique in your account
email optional · body email
company optional · body string
curl -X POST "https://pbx.itfair.bd/api/contacts" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "first_name": "Karim",
      "phone_number": "01712345678"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/contacts', [
        'first_name' => 'Karim',
        'phone_number' => '01712345678',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/contacts', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "first_name": "Karim",
      "phone_number": "01712345678"
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/contacts",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"first_name":"Karim","phone_number":"01712345678"},
)
data = res.json()

Response 201

{
    "id": 41,
    "first_name": "Karim",
    "phone_number": "01712345678"
}

Get a contact #

GET /api/contacts/{contact}

Ability: crm:read

Get a contact parameters
ParameterTypeDescription
contact required · path integer
curl -X GET "https://pbx.itfair.bd/api/contacts/41" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/contacts/41');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/contacts/41', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/contacts/41",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

{
    "id": 41
}

Update a contact #

PUT /api/contacts/{contact}

Ability: crm:write

Update a contact parameters
ParameterTypeDescription
contact required · path integer
company optional · body string Same fields as create.
curl -X PUT "https://pbx.itfair.bd/api/contacts/41" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "company": "Shop BD"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->put('https://pbx.itfair.bd/api/contacts/41', [
        'company' => 'Shop BD',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/contacts/41', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "company": "Shop BD"
  }),
});
const data = await res.json();
import requests

res = requests.put(
    "https://pbx.itfair.bd/api/contacts/41",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"company":"Shop BD"},
)
data = res.json()

Response 200

{
    "id": 41,
    "company": "Shop BD"
}

Delete a contact #

DELETE /api/contacts/{contact}

Ability: crm:write

Delete a contact parameters
ParameterTypeDescription
contact required · path integer
curl -X DELETE "https://pbx.itfair.bd/api/contacts/41" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->delete('https://pbx.itfair.bd/api/contacts/41');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/contacts/41', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.delete(
    "https://pbx.itfair.bd/api/contacts/41",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 204

(empty body)

Calls and notes for a contact #

GET /api/contacts/{contact}/timeline

Ability: crm:read

Calls and notes for a contact parameters
ParameterTypeDescription
contact required · path integer
curl -X GET "https://pbx.itfair.bd/api/contacts/41/timeline" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/contacts/41/timeline');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/contacts/41/timeline', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/contacts/41/timeline",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

[
    {
        "type": "call",
        "created_at": "2026-09-27T10:14:03+06:00"
    },
    {
        "type": "note",
        "created_at": "2026-09-26T16:00:00+06:00"
    }
]

List call dispositions #

GET /api/dispositions

Ability: crm:read

Create/update/delete (POST, PUT, DELETE /api/dispositions/{id}, body name, is_active) need an owner, admin or supervisor token.

curl -X GET "https://pbx.itfair.bd/api/dispositions" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/dispositions');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/dispositions', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/dispositions",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

[
    {
        "id": 3,
        "name": "Call back later",
        "is_active": true
    }
]

Campaigns

কন্টাক্ট লিস্ট ও অটো-ডায়ালার ক্যাম্পেইন।

Manage contact lists and power-dialer / broadcast campaigns. Write access needs an owner, admin or supervisor token.

Plan feature: AI Campaign & Bulk Calling

Create a contact list #

POST /api/contact-lists

Ability: campaigns:write

Also GET/PUT/DELETE /api/contact-lists/{id} and GET /api/contact-lists.

Create a contact list parameters
ParameterTypeDescription
name required · body string max 255
description optional · body string
curl -X POST "https://pbx.itfair.bd/api/contact-lists" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "name": "Eid leads"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/contact-lists', [
        'name' => 'Eid leads',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/contact-lists', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "name": "Eid leads"
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/contact-lists",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"name":"Eid leads"},
)
data = res.json()

Response 201

{
    "id": 9,
    "name": "Eid leads"
}

Add a contact to a list #

POST /api/contact-lists/{list}/attach

Ability: campaigns:write

Add a contact to a list parameters
ParameterTypeDescription
list required · path integer
contact_id required · body integer existing contact
curl -X POST "https://pbx.itfair.bd/api/contact-lists/9/attach" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "contact_id": 41
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/contact-lists/9/attach', [
        'contact_id' => 41,
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/contact-lists/9/attach', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "contact_id": 41
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/contact-lists/9/attach",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"contact_id":41},
)
data = res.json()

Response 200

{
    "message": "Contact attached"
}

Create a campaign #

POST /api/campaigns

Ability: campaigns:write

Also GET /api/campaigns, GET/PUT/DELETE /api/campaigns/{id}.

Create a campaign parameters
ParameterTypeDescription
name required · body string max 255
type required · body string broadcast | power (power needs Power Dialer)
contact_list_id required · body integer your list
ivr_id optional · body integer Message/IVR to play.required for broadcast
call_queue_id optional · body integer Agents who take answered calls.required for power
concurrency_limit required · body integer Parallel calls.1 – your free lines
status optional · body string draft | paused
curl -X POST "https://pbx.itfair.bd/api/campaigns" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "name": "Eid reminder",
      "type": "broadcast",
      "contact_list_id": 9,
      "ivr_id": 7,
      "concurrency_limit": 3
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/campaigns', [
        'name' => 'Eid reminder',
        'type' => 'broadcast',
        'contact_list_id' => 9,
        'ivr_id' => 7,
        'concurrency_limit' => 3,
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/campaigns', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "name": "Eid reminder",
      "type": "broadcast",
      "contact_list_id": 9,
      "ivr_id": 7,
      "concurrency_limit": 3
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/campaigns",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"name":"Eid reminder","type":"broadcast","contact_list_id":9,"ivr_id":7,"concurrency_limit":3},
)
data = res.json()

Response 201

{
    "id": 15,
    "name": "Eid reminder",
    "type": "broadcast",
    "status": "draft"
}

Start a campaign #

POST /api/campaigns/{campaign}/start

Ability: campaigns:write

Fires campaign.started.

Start a campaign parameters
ParameterTypeDescription
campaign required · path integer
curl -X POST "https://pbx.itfair.bd/api/campaigns/15/start" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/campaigns/15/start');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/campaigns/15/start', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/campaigns/15/start",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

{
    "status": "active",
    "campaign": {
        "id": 15
    }
}

Pause a campaign #

POST /api/campaigns/{campaign}/pause

Ability: campaigns:write

Fires campaign.paused.

Pause a campaign parameters
ParameterTypeDescription
campaign required · path integer
curl -X POST "https://pbx.itfair.bd/api/campaigns/15/pause" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/campaigns/15/pause');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/campaigns/15/pause', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/campaigns/15/pause",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

{
    "status": "paused",
    "campaign": {
        "id": 15
    }
}

PBX configuration

এক্সটেনশন, নম্বর, রিং গ্রুপ, আইভিআর ও কিউ।

Read and change your phone system. Needs an owner or admin token with pbx:*. Each resource supports GET list, POST create, GET/PUT/DELETE /{id}.

Plan feature: Developer API Access

List extensions #

GET /api/extensions

Ability: pbx:read

Read-only. GET /api/extensions/{id} for one.

curl -X GET "https://pbx.itfair.bd/api/extensions" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/extensions');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/extensions', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/extensions",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

[
    {
        "id": 5,
        "extension": "101",
        "name": "Rahim"
    }
]

Numbers (DIDs) #

POST /api/dids

Ability: pbx:write

Numbers (DIDs) parameters
ParameterTypeDescription
number required · body string unique
label optional · body string
routable_type optional · body string Where calls go (e.g. Ivr).
routable_id optional · body integer
curl -X POST "https://pbx.itfair.bd/api/dids" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "number": "09639000000",
      "label": "Hotline"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/dids', [
        'number' => '09639000000',
        'label' => 'Hotline',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/dids', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "number": "09639000000",
      "label": "Hotline"
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/dids",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"number":"09639000000","label":"Hotline"},
)
data = res.json()

Response 201

{
    "id": 2,
    "number": "09639000000"
}

Ring groups #

POST /api/ring-groups

Ability: pbx:write

Ring groups parameters
ParameterTypeDescription
name required · body string
extension_number required · body string
strategy optional · body string ring-all | round-robin | random | sequential
ring_time optional · body integer ≥ 1 second
extensions optional · body array extension ids
curl -X POST "https://pbx.itfair.bd/api/ring-groups" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "name": "Sales",
      "extension_number": "600",
      "strategy": "ring-all",
      "ring_time": 20,
      "extensions": [
          5,
          6
      ]
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/ring-groups', [
        'name' => 'Sales',
        'extension_number' => '600',
        'strategy' => 'ring-all',
        'ring_time' => 20,
        'extensions' => [
            5,
            6,
        ],
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/ring-groups', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "name": "Sales",
      "extension_number": "600",
      "strategy": "ring-all",
      "ring_time": 20,
      "extensions": [
          5,
          6
      ]
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/ring-groups",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"name":"Sales","extension_number":"600","strategy":"ring-all","ring_time":20,"extensions":[5,6]},
)
data = res.json()

Response 201

{
    "id": 4,
    "name": "Sales"
}

IVR menus #

POST /api/ivrs

Ability: pbx:write

IVR menus parameters
ParameterTypeDescription
name required · body string
greeting_audio optional · body string uploaded audio name
timeout optional · body integer
options optional · body array {digit, target_type: Extension|RingGroup|Ivr|Voicemail|Hangup, target_value}
curl -X POST "https://pbx.itfair.bd/api/ivrs" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "name": "Main menu",
      "timeout": 5,
      "options": [
          {
              "digit": "1",
              "target_type": "RingGroup",
              "target_value": "4"
          }
      ]
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/ivrs', [
        'name' => 'Main menu',
        'timeout' => 5,
        'options' => [
            [
                'digit' => '1',
                'target_type' => 'RingGroup',
                'target_value' => '4',
            ],
        ],
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/ivrs', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "name": "Main menu",
      "timeout": 5,
      "options": [
          {
              "digit": "1",
              "target_type": "RingGroup",
              "target_value": "4"
          }
      ]
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/ivrs",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"name":"Main menu","timeout":5,"options":[{"digit":"1","target_type":"RingGroup","target_value":"4"}]},
)
data = res.json()

Response 201

{
    "id": 7,
    "name": "Main menu"
}

Call queues #

POST /api/queues

Ability: pbx:write Plan: ACD Call Queues

Call queues parameters
ParameterTypeDescription
name required · body string
extension_number required · body string
strategy required · body string ringall | leastrecent | fewestcalls | random | rrmemory
max_wait_time optional · body integer seconds
extensions optional · body array {id, penalty}
curl -X POST "https://pbx.itfair.bd/api/queues" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "name": "Support",
      "extension_number": "700",
      "strategy": "leastrecent",
      "max_wait_time": 120,
      "extensions": [
          {
              "id": 5,
              "penalty": 0
          }
      ]
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/queues', [
        'name' => 'Support',
        'extension_number' => '700',
        'strategy' => 'leastrecent',
        'max_wait_time' => 120,
        'extensions' => [
            [
                'id' => 5,
                'penalty' => 0,
            ],
        ],
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/queues', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "name": "Support",
      "extension_number": "700",
      "strategy": "leastrecent",
      "max_wait_time": 120,
      "extensions": [
          {
              "id": 5,
              "penalty": 0
          }
      ]
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/queues",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"name":"Support","extension_number":"700","strategy":"leastrecent","max_wait_time":120,"extensions":[{"id":5,"penalty":0}]},
)
data = res.json()

Response 201

{
    "id": 2,
    "name": "Support"
}

Call forwarding rules #

POST /api/forwarding-rules

Ability: pbx:write

Call forwarding rules parameters
ParameterTypeDescription
extension_id required · body integer
condition required · body string always | busy | no_answer | offline
target_type required · body string extension | ring_group | external | voicemail
target_value optional · body string
curl -X POST "https://pbx.itfair.bd/api/forwarding-rules" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "extension_id": 5,
      "condition": "no_answer",
      "target_type": "external",
      "target_value": "01712345678"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/forwarding-rules', [
        'extension_id' => 5,
        'condition' => 'no_answer',
        'target_type' => 'external',
        'target_value' => '01712345678',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/forwarding-rules', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "extension_id": 5,
      "condition": "no_answer",
      "target_type": "external",
      "target_value": "01712345678"
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/forwarding-rules",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"extension_id":5,"condition":"no_answer","target_type":"external","target_value":"01712345678"},
)
data = res.json()

Response 201

{
    "id": 3
}

SIP trunks #

POST /api/sip-trunks

Ability: pbx:write

SIP trunks parameters
ParameterTypeDescription
name required · body string
host required · body string
port optional · body integer
username optional · body string
password optional · body string
curl -X POST "https://pbx.itfair.bd/api/sip-trunks" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "name": "Carrier A",
      "host": "sip.carrier.example",
      "port": 5060
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/sip-trunks', [
        'name' => 'Carrier A',
        'host' => 'sip.carrier.example',
        'port' => 5060,
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/sip-trunks', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "name": "Carrier A",
      "host": "sip.carrier.example",
      "port": 5060
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/sip-trunks",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"name":"Carrier A","host":"sip.carrier.example","port":5060},
)
data = res.json()

Response 201

{
    "id": 1,
    "name": "Carrier A"
}

Agents

এজেন্ট স্ট্যাটাস ও সুপারভাইজার অ্যাকশন।

Read and change agent availability.

Plan feature: Developer API Access

All agent statuses #

GET /api/agent-status

Ability: agents:read

curl -X GET "https://pbx.itfair.bd/api/agent-status" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/agent-status');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/agent-status', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/agent-status",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

[
    {
        "extension_id": 5,
        "status": "available"
    }
]

Set an agent’s status #

PUT /api/agent-status/{extension_id}

Ability: agents:write

Set an agent’s status parameters
ParameterTypeDescription
extension_id required · path integer
status required · body string offline | available | busy | paused | wrap_up
paused_reason optional · body string
curl -X PUT "https://pbx.itfair.bd/api/agent-status/5" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "status": "paused",
      "paused_reason": "Lunch"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->put('https://pbx.itfair.bd/api/agent-status/5', [
        'status' => 'paused',
        'paused_reason' => 'Lunch',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/agent-status/5', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "status": "paused",
      "paused_reason": "Lunch"
  }),
});
const data = await res.json();
import requests

res = requests.put(
    "https://pbx.itfair.bd/api/agent-status/5",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"status":"paused","paused_reason":"Lunch"},
)
data = res.json()

Response 200

{
    "extension_id": 5,
    "status": "paused"
}

Supervisor: force pause #

POST /api/agent-status/{extension_id}/force-pause

Ability: agents:write Plan: Call Monitoring

Supervisor: force pause parameters
ParameterTypeDescription
extension_id required · path integer
paused_reason optional · body string
curl -X POST "https://pbx.itfair.bd/api/agent-status/5/force-pause" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "paused_reason": "Coaching"
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/agent-status/5/force-pause', [
        'paused_reason' => 'Coaching',
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/agent-status/5/force-pause', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "paused_reason": "Coaching"
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/agent-status/5/force-pause",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"paused_reason":"Coaching"},
)
data = res.json()

Response 200

{
    "status": "paused"
}

Supervisor: force logout #

POST /api/agent-status/{extension_id}/force-logout

Ability: agents:write Plan: Call Monitoring

Supervisor: force logout parameters
ParameterTypeDescription
extension_id required · path integer
curl -X POST "https://pbx.itfair.bd/api/agent-status/5/force-logout" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/agent-status/5/force-logout');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/agent-status/5/force-logout', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/agent-status/5/force-logout",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

{
    "status": "offline"
}

API tokens

এপিআই টোকেন তৈরি ও বাতিল।

Manage tokens from code (the panel page API Keys does the same). Owner or admin token with tokens:*.

Plan feature: Developer API Access

List tokens #

GET /api/api-tokens

Ability: tokens:read

curl -X GET "https://pbx.itfair.bd/api/api-tokens" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->get('https://pbx.itfair.bd/api/api-tokens');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/api-tokens', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.get(
    "https://pbx.itfair.bd/api/api-tokens",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 200

[
    {
        "id": 8,
        "name": "Shop server",
        "abilities": [
            "otp:send",
            "otp:verify"
        ],
        "expires_at": "2026-12-26T10:00:00+06:00"
    }
]

Create a token #

POST /api/api-tokens

Ability: tokens:write

The plain token is returned once. Abilities are limited to what your role may grant.

Create a token parameters
ParameterTypeDescription
name required · body string max 255
abilities optional · body array ability names, default all you may grant
curl -X POST "https://pbx.itfair.bd/api/api-tokens" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
      "name": "Shop server",
      "abilities": [
          "otp:send",
          "otp:verify"
      ]
  }'
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->post('https://pbx.itfair.bd/api/api-tokens', [
        'name' => 'Shop server',
        'abilities' => [
            'otp:send',
            'otp:verify',
        ],
    ]);

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/api-tokens', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "name": "Shop server",
      "abilities": [
          "otp:send",
          "otp:verify"
      ]
  }),
});
const data = await res.json();
import requests

res = requests.post(
    "https://pbx.itfair.bd/api/api-tokens",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    json={"name":"Shop server","abilities":["otp:send","otp:verify"]},
)
data = res.json()

Response 201

{
    "token": "9|pX2…",
    "name": "Shop server"
}

Revoke a token #

DELETE /api/api-tokens/{api_token}

Ability: tokens:write

Revoke a token parameters
ParameterTypeDescription
api_token required · path integer Token id.
curl -X DELETE "https://pbx.itfair.bd/api/api-tokens/8" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
use Illuminate\Support\Facades\Http;

$response = Http::withToken($token)
    ->acceptJson()
    ->delete('https://pbx.itfair.bd/api/api-tokens/8');

$data = $response->json();
const res = await fetch('https://pbx.itfair.bd/api/api-tokens/8', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: 'application/json',
  },
});
const data = await res.json();
import requests

res = requests.delete(
    "https://pbx.itfair.bd/api/api-tokens/8",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
)
data = res.json()

Response 204

(empty body)

Webhooks

ঘটনা ঘটলেই আপনার সার্ভারে POST রিকোয়েস্ট যায়।

Add endpoints in the panel (Webhooks) or with the webhook endpoints API. We POST a JSON envelope to each active endpoint subscribed to the event. Reply with any 2xx within 10 seconds; otherwise we retry with back-off. Retries resend the same id, so de-duplicate on it.

POST /your/webhook
X-CallCRM-Event: otp.verified
X-CallCRM-Timestamp: 1727409731
X-CallCRM-Signature: 5f2b…(hex HMAC-SHA256)

{
  "id": "7c1e0f7e-6a0b-4a52-9d6a-2a4f1a8a3c11",
  "event": "otp.verified",
  "created_at": "2026-09-27T10:02:11+06:00",
  "tenant_id": 12,
  "data": { "otp_id": 1234, "phone_number": "01712345678", "verified_at": "…" }
}

Verify signatures

X-CallCRM-Signature = hex HMAC-SHA256 of "{timestamp}.{raw_body}" with the endpoint’s secret. Reject requests older than 5 minutes.

$payload   = file_get_contents('php://input');
$timestamp = $_SERVER['HTTP_X_CALLCRM_TIMESTAMP'] ?? '';
$signature = $_SERVER['HTTP_X_CALLCRM_SIGNATURE'] ?? '';

$expected = hash_hmac('sha256', $timestamp . '.' . $payload, $secret);

if (! hash_equals($expected, $signature) || abs(time() - (int) $timestamp) > 300) {
    http_response_code(401);
    exit;
}

$event = json_decode($payload, true);   // de-duplicate by $event['id']
http_response_code(200);
import crypto from 'node:crypto';

// Use the RAW body (e.g. express.raw({ type: 'application/json' })).
function verify(rawBody, timestamp, signature, secret) {
  const expected = crypto.createHmac('sha256', secret)
    .update(`${timestamp}.${rawBody}`).digest('hex');
  const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) <= 300;
  return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}
import hmac, hashlib, time

def verify(raw_body: bytes, timestamp: str, signature: str, secret: str) -> bool:
    expected = hmac.new(secret.encode(), f"{timestamp}.".encode() + raw_body,
                        hashlib.sha256).hexdigest()
    fresh = abs(time.time() - int(timestamp)) <= 300
    return fresh and hmac.compare_digest(expected, signature)

Events

Only events the platform sends today are listed. More will be added here when they go live.

otp.sent The OTP call was placed.
{
    "data": {
        "otp_id": 1234,
        "phone_number": "01712345678",
        "expires_at": "2026-09-27T10:05:00+06:00"
    }
}
otp.verified The user entered the right code.
{
    "data": {
        "otp_id": 1234,
        "phone_number": "01712345678",
        "verified_at": "2026-09-27T10:02:11+06:00"
    }
}
ivr.option_selected A caller pressed an IVR option that has “Send webhook” on.
{
    "data": {
        "call_id": 88121,
        "asterisk_uniqueid": "1727430000.43",
        "direction": "outbound",
        "caller": "01712345678",
        "did": "09639000000",
        "ivr_id": 7,
        "ivr_name": "Order confirmation",
        "digit": "1",
        "option_label": "Order confirmed",
        "option_value": "confirmed",
        "next_action": {
            "type": "hangup",
            "value": null
        },
        "metadata": {
            "order_id": "WC-10045"
        },
        "auto_call_id": 551,
        "delayed": false,
        "pressed_at": "2026-09-27T10:20:31+06:00"
    }
}
auto_call.completed An auto call finished (answered or not).
{
    "data": {
        "auto_call_id": 551,
        "to": "01712345678",
        "ivr_id": 7,
        "status": "answered_with_input",
        "attempts": 1,
        "digits_pressed": "1",
        "option_value": "confirmed",
        "option_label": "Order confirmed",
        "duration": 18,
        "call_id": 88121,
        "metadata": {
            "order_id": "WC-10045"
        },
        "completed_at": "2026-09-27T10:20:40+06:00"
    }
}
call.completed A call was rated after it ended (all call fields).
{
    "data": {
        "id": 88120,
        "direction": "outbound",
        "caller_id_number": "101",
        "dialed_number": "01712345678",
        "duration": 74,
        "billsec": 61,
        "disposition": "ANSWERED",
        "cost": "0.46",
        "…": "…"
    }
}
campaign.started A campaign was started.
{
    "data": {
        "campaign_id": 15,
        "name": "Eid reminder",
        "type": "broadcast"
    }
}
campaign.paused A campaign was paused.
{
    "data": {
        "campaign_id": 15,
        "name": "Eid reminder"
    }
}
ping.test You pressed “Send test” in the panel (sent to that endpoint even if it filters events).
{
    "data": {
        "event": "ping.test",
        "message": "Hello from CallCRM! This is an instantaneous webhook test ping.",
        "timestamp": "2026-09-27T10:00:00+06:00",
        "triggered_by": "Karim"
    }
}

Signature calculator

Check your verification code: paste a secret, timestamp and raw body to see the expected signature. Runs only in your browser.

X-CallCRM-Signature: —

Postman & support

Import a collection, set baseUrl and token, and every request is ready.

Questions about an integration? Call +8809638461270.