Documentation

Phone Number API

Manage phone numbers for outbound and inbound calls, and assign them to agents. All endpoints require Authorization: Bearer YOUR_JWT from login. See the Numbers Shop guide for buying new numbers.

List Phone Numbers

Fetch the phone numbers saved to your workspace. Returns data.phoneNumbers (array of number objects with id, number, externalId — use externalId as from_number_id when dispatching calls — provider, agentId). The dashboard also shows this as Phone Number ID with a Copy button.

cURL
curl -X GET "https://bkbharatai.blutec.ai/api/phone-numbers" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json"

List Provider Numbers

List numbers available from your connected provider account (paginated with pageno and pagesize). Returns data.upstreamPhoneNumbers.

cURL
curl -X GET "https://bkbharatai.blutec.ai/api/phone-numbers/upstream?pageno=1&pagesize=20" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json"

Assign Phone Number to Agent

Link a saved phone number to an agent so calls are routed through that agent. Replace PN_ID with the number's id from the list endpoint.

cURL
curl -X POST "https://bkbharatai.blutec.ai/api/phone-numbers/PN_ID/assign" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "AGENT_ID"
  }'

Detach Phone Number

Remove the association between a phone number and its currently attached agent.

cURL
curl -X POST "https://bkbharatai.blutec.ai/api/phone-numbers/PN_ID/detach" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json"

Import Twilio Number

Bring an existing Twilio phone number into your Blutec workspace by providing the phone number, Account SID, and Auth Token. The number becomes available for use in agents and campaigns.

cURL
curl -X POST "https://bkbharatai.blutec.ai/api/phone-numbers/import-twilio" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+1234567890",
    "account_sid": "AC1234567890abcdef1234567890abcdef",
    "account_token": "your_twilio_auth_token",
    "name": "My Twilio Number"
  }'

Import SIP Trunk

Register a SIP trunk as a phone number by specifying the SIP host, trunk name, and optional port, credentials, dial prefix, and strip-plus setting. Proxies to OmniDimension POST /phone_number/import/sip.

cURL
curl -X POST "https://bkbharatai.blutec.ai/api/phone-numbers/import-sip" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+1234567890",
    "sip_host": "sip.yourprovider.com",
    "sip_trunk_name": "my-sip-trunk",
    "name": "My SIP Number",
    "sip_port": 5060,
    "sip_username": "user123",
    "sip_password": "secret",
    "sip_dial_prefix": "91",
    "sip_strip_plus": true
  }'

Remove Phone Number

Remove a phone number from your workspace.

cURL
curl -X DELETE "https://bkbharatai.blutec.ai/api/phone-numbers/PN_ID" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json"