White-Label Reseller API (V2)

Automate your Cloud PBX SaaS customer management seamlessly. Use this RESTful API to integrate ePBX functionalities directly into your own applications, billing portals, or CRM systems.

Authentication

All API requests require a Bearer token. You can generate your Developer API Key from your Reseller Dashboard under the White Label settings.

Authorization: Bearer YOUR_DEVELOPER_TOKEN

Base URL

https://www.epbx.bd/api/v2

Rate Limiting

API requests are rate-limited to 60 requests per minute per tenant to ensure platform stability. Exceeding this limit will return a 429 Too Many Requests response.

Standard Error Codes

Code Meaning Description
200/201 Success The request was successful.
401 Unauthorized Missing or invalid Bearer Token.
422 Validation Error Missing required parameters or incorrect data types. Check JSON response for details.
500 Server Error An internal system error occurred.

Endpoints

GET /customers

List All Customers

Retrieve a paginated list of all your active customers/tenants.

Response

{
  "status": "success",
  "data": [
    {
      "id": 1,
      "company_name": "Acme Corp",
      "domain": "acme.epbx.bd"
    }
  ]
}
POST /customers

Create Customer

Create a new Tenant (Customer) in the system and automatically provision their PBX environment.

Parameters

Field Type Description
company_name string (required) The name of the new tenant's company. Used to generate subdomains.
email string (required) Admin email address for the tenant.
package_id integer (required) ID of the billing package assigned to this tenant.

Request Body Example

{
    "company_name": "Example Corp",
    "email": "admin@example.com",
    "package_id": 1
}
PUT /customers/{customerId}/status

Suspend/Unsuspend Customer

Change the operational status of a customer's PBX tenant. Suspended tenants cannot make or receive calls.

Parameters (JSON)

Field Type Description
status string Required. Must be either active or suspended.
POST /customers/{customerId}/kyc

Submit KYC

Upload KYC documents and information for a customer. Use multipart/form-data for this request.

Form Data (multipart/form-data)

NID Number: 1234567890 (Text)
NID Front: nid_front.jpg (File)
Trade License: trade_license.pdf (File)
Address: 123 Main St (Text)
GET /telephony/customers/{customerId}/extensions

List Extensions

Retrieve all PBX extensions associated with a specific customer.

POST /telephony/customers/{customerId}/extensions

Create Extension

Provision a new SIP extension for the customer. SIP and WebRTC softphone profiles are configured automatically behind the scenes.

Parameters

Field Type Description
extension integer (required) The numeric extension number (e.g. 101). Auto-assigned if omitted.
password string (required) Strong SIP secret password (min 4 chars).
is_webrtc boolean (optional) Set to true to generate WebRTC profile and return WSS credentials.

Request Body Example

{
    "extension": "105",
    "password": "SecurePassword123",
    "is_webrtc": true
}

Response (if is_webrtc = true)

{
  "status": "success",
  "data": {
    "extension": "105",
    "password": "SecurePassword123",
    "webrtc": {
      "username": "105_webrtc",
      "password": "SecurePassword123",
      "domain": "pbx.yourdomain.com",
      "wss_server": "wss://pbx.yourdomain.com:8089/ws"
    }
  }
}
PUT /customers/{customerId}/extensions/{extensionId}

Update Extension

Update the SIP password of an existing extension.

Parameters (JSON)

Field Type Description
password string Required. New secure SIP password.
DELETE /customers/{customerId}/extensions/{extensionId}

Delete Extension

Permanently remove an extension from a customer's PBX. This action unregisters the device immediately.

INFO Connect Softphones

Softphone Apps & WebRTC Integration

Our PBX system supports both traditional SIP applications (like Zoiper or MicroSIP) and integrated WebRTC browser softphones. Use the credentials returned from the Create Extension endpoint to connect.

1. Standard Softphones (Zoiper, MicroSIP)

  • Domain/Server: pbx.yourdomain.com
  • Username: 105 (your extension number)
  • Password: SecurePassword123
  • Transport: UDP (Port 5060)

2. WebRTC Browser Softphones

  • WSS Server: wss://pbx.yourdomain.com/ws
  • Username (SIP URI): 105_webrtc
  • Authentication Username: 105
  • DTLS/SRTP Media Encryption is handled automatically.

Test your WebRTC connection live in your browser:

Open WebRTC Test Client
POST /telephony/customers/{customerId}/numbers/request

Request Custom Number

Submit an order for a custom DID Number or SIP Trunk based on the selected provider. You can specify your preferred digits (e.g., the last 6 digits of the phone number). Once approved by the administrator, the trunk will be automatically assigned to the customer.

Parameters

Field Type Description
preferred_digits string (required) The requested DID prefix (e.g. 096).
provider_id integer (required) Target provider gateway ID.
requested_channels integer (required) Concurrent calls requested for this trunk.
notes string (optional) Additional requirements for the provider.

Request Body Example

{
    "preferred_digits": "096",
    "provider_id": 1,
    "requested_channels": 2,
    "notes": "Need this number for outbound call center."
}
POST /telephony/customers/{customerId}/ivrs

Create IVR (Auto Attendant)

Programmatically configure Interactive Voice Response (IVR) menus for the customer. Upload custom greeting audio and define key-press routing logic.

Parameters

Field Type Description
name string (required) Name of the IVR (e.g., Main Menu).
greeting_audio file (required) WAV/MP3 audio file to play to callers.
routes array (optional) Array of objects mapping DTMF digits (0-9) to destinations.

Request Body Example

{
    "name": "Main Menu",
    "greeting_audio": "(binary file data)",
    "routes": [
        {"digit": "1", "destination_type": "extension", "destination_id": "101"},
        {"digit": "2", "destination_type": "queue", "destination_id": "200"}
    ]
}
POST /telephony/customers/{customerId}/inbound-routes

Create Inbound Route

Define how incoming calls to a specific DID number should be routed within the customer's PBX.

Parameters

Field Type Description
did_number string (required) The incoming DID number (e.g., 096...).
destination_type enum (required) Accepts "ivr", "extension", "queue", or "time_condition".
destination_id string (required) The target identifier (e.g., IVR ID or Extension Number).
POST /telephony/customers/{customerId}/outbound-routes

Create Outbound Route

Configure dialing rules and match patterns to determine which SIP Trunk should be used for outgoing calls.

Parameters

Field Type Description
name string (required) Descriptive name for the route.
match_pattern string (required) Dial pattern (e.g., _01X. for mobile numbers).
trunk_id integer (required) The ID of the SIP Trunk to route the call through.
POST /telephony/customers/{customerId}/time-conditions

Create Time Schedule (Business Hours)

Set up business hours to route calls dynamically. For example, route to IVR during working hours, and Voicemail after hours.

Parameters

Field Type Description
name string (required) Name of the schedule (e.g., Standard Office Hours).
schedule object (required) JSON defining days and time ranges (e.g. Mon-Fri, 09:00-17:00).
match_destination object (required) Where to route if inside business hours.
unmatch_destination object (required) Where to route if outside business hours.
POST /telephony/customers/{customerId}/trunks

Configure SIP Trunk

Add a third-party SIP Trunk directly to the customer's PBX profile. The system will automatically construct the registration string and connect to the provider instantly.

Parameters

Field Type Description
name string (required) Display name for the SIP trunk.
host string (required) IP address or FQDN of the upstream provider.
username string (required) SIP Authentication Username.
secret string (required) SIP Authentication Password.

Automatic Connection: When you post these credentials, our Zero-Touch Engine automatically reloads the backend dialplan rules and attempts registration with the provider in real-time. You do not need to restart any services.

GET /customers/{customerId}/cdr

Call Data Records (CDR)

Retrieve paginated call history and billing records for a specific customer. Essential for custom billing dashboards.

Query Parameters

Param Description
start_dateOptional. Format: YYYY-MM-DD
end_dateOptional. Format: YYYY-MM-DD
dispositionOptional. ANSWERED, NO ANSWER, BUSY, FAILED.
POST /customers/{customerId}/calls/originate

Click-to-Call (Originate)

Trigger a call from your CRM. The system will first ring the agent's extension, and upon answering, it will dial the customer's phone number.

Parameters (JSON)

extensionstringRequired. Agent's extension number (e.g. 101).
phone_numberstringRequired. The destination number to dial.
GET /wallet/balance

Wallet Balance

Retrieve your current Reseller Wallet balance programmatically.

POST /wallet/customers/{customerId}/topup

Wallet Top-up

Transfer funds from your Reseller Wallet to a customer, or deduct funds from a customer. This automatically creates ledger entries.

Parameters

Field Type Description
amount float (required) Amount to transfer in local currency.
action enum (required) Accepts "add" (top-up) or "deduct" (remove funds).

Request Body Example

{
    "amount": 500.00,
    "action": "add" // Use "add" to top-up, "deduct" to remove funds
}
GET /ping

Ping (Health Check)

Verify your API Token validity and White Label permissions.

© 2026 ePBX.bd Developer API. All rights reserved.
UPCOMING Real-Time Event Webhooks

Webhooks Architecture

We are currently building a powerful webhook dispatch engine. You will be able to register a callback URL to receive real-time HTTP POST payloads whenever:

  • An inbound call starts ringing on an extension.
  • A call is answered or hung up.
  • A tenant wallet drops below a threshold.
Note: Webhooks are scheduled for release in Q3. Stay tuned for the event schema documentation.