Documentation

Full API Reference

Every endpoint the Blutec Echo dashboard uses. Build the same UI or your own app using these APIs. Each endpoint lists which part of the UI uses it so you can replicate behaviour.

Auth: Authorization: Bearer <JWT> from login, or your API key for programmatic access.

Authentication

Sign up, login, profile, and password. No auth header for signup/login.

Used in UI: Login page, Signup page, Settings (profile & change password), header "Me".

POST/api/auth/signup(no auth)

Create account

UI: Signup page → submit

Body: {"email":"string","password":"string","name":"string (optional)"}

Response: { success, data: { user, token } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/auth/signup" \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","password":"SecurePass123","name":"Your Name"}'
POST/api/auth/login(no auth)

Get JWT

UI: Login page → submit

Body: {"email":"string","password":"string"}

Response: { success, data: { user, token } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/auth/login" \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","password":"YourPassword"}'
GET/api/auth/me

Current user

UI: Dashboard layout (user info), Settings

Response: { success, data: { user } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/auth/me" \
  -H "Authorization: Bearer YOUR_TOKEN"
PUT/api/auth/profile

Update profile

UI: Settings → profile form

Body: {"name":"string","email":"string (optional)"}

Response: { success, data: { user } }

Example
curl -X PUT "https://bkbharatai.blutec.ai/api/auth/profile" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"New Name"}'
POST/api/auth/change-password

Change password

UI: Settings → change password form

Body: {"current_password":"string","new_password":"string"}

Response: { success }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/auth/change-password" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"current_password":"old","new_password":"new"}'

Agents (Assistants)

CRUD for voice agents. Create/update supports full config: voice, model, transcriber, context_breakdown, transfer, end_call, filler, web_search, post_call.

Used in UI: Dashboard (Assistants list), Agent detail (all tabs: Assistant Details, Call Config, Knowledge Base, Integrations, Post-Call, Recent Calls).

POST/api/agents/create

Create agent

UI: Dashboard → "Create agent" or default agent creation

Body: "name, welcome_message, context_breakdown[], voice{}, model{}, transcriber{}, languages[], transfer{}, end_call{}, filler{}, web_search{}, post_call_actions{} (or legacy post_call{}). See Agent API doc."

Response: { success, data: { id/agent_id, ... } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/agents/create" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"My Agent","welcome_message":"Hello!","context_breakdown":[{"title":"Purpose","body":"Help the user.","is_enabled":true}],"filler":{"enabled":true,"after_sec":1.5,"fillers":["Let me check that for you","One moment please"]}}'
GET/api/agents

List agents

UI: Dashboard → Assistants list, Agent dropdowns elsewhere

Query: "pageno, pagesize (optional)"

Response: { success, data: { agents[], total } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/agents?pageno=1&pagesize=20" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/agents/:agentId

Get agent

UI: Agent detail page (load full config)

Response: { success, data: { agent object } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/agents/AGENT_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"
PUT/api/agents/:agentId

Update agent

UI: Agent detail → Save (any tab). Partial update supported.

Body: "Any subset: name, welcome_message, context_breakdown, voice, model, transcriber, transfer, end_call, filler, web_search, post_call, etc."

Response: { success, data }

Example
curl -X PUT "https://bkbharatai.blutec.ai/api/agents/AGENT_ID" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"filler":{"enabled":true,"after_sec":1.5,"fillers":["Let me check that for you","One moment please"]}}'
DELETE/api/agents/:agentId

Delete agent

UI: Agent detail → Delete agent

Response: { success }

Example
curl -X DELETE "https://bkbharatai.blutec.ai/api/agents/AGENT_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/agents/:agentId/integrations

List agent integrations

UI: Agent detail → Integrations tab (list attached)

Response: { success, data: { integrations[] } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/agents/AGENT_ID/integrations" \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/api/agents/:agentId/integrations

Attach integration to agent

UI: Agent detail → Integrations tab → Attach; Integrations page → Attach to agent

Body: {"integration_id":"number"}

Response: { success }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/agents/AGENT_ID/integrations" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"integration_id":123}'
DELETE/api/agents/:agentId/integrations/:integrationId

Detach integration

UI: Agent detail → Integrations tab → Detach

Response: { success }

Example
curl -X DELETE "https://bkbharatai.blutec.ai/api/agents/AGENT_ID/integrations/INT_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/agents/:agentId/widget-config

Get widget config

UI: Agent detail → Deploy → Website widget

Response: { success, data: { widget config } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/agents/AGENT_ID/widget-config" \
  -H "Authorization: Bearer YOUR_TOKEN"
PUT/api/agents/:agentId/widget-config

Update widget config

UI: Agent detail → Deploy → Website widget modal

Body: "Widget options object"

Response: { success }

Example
curl -X PUT "https://bkbharatai.blutec.ai/api/agents/AGENT_ID/widget-config" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
GET/api/agents/:agentId/web-call

Get web call URL

UI: Agent detail → Deploy → Phone Call / web call link

Response: { success, data: { url } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/agents/AGENT_ID/web-call" \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/api/agents/:agentId/web-chat

Web chat (programmatic)

UI: Embedded web chat widget backend

Body: "Messages, session, etc."

Response: Chat response

Example
curl -X POST "https://bkbharatai.blutec.ai/api/agents/AGENT_ID/web-chat" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"message":"Hello"}'

Knowledge Base

Upload files, attach/detach to agents, delete. Used for RAG context.

Used in UI: Dashboard → Knowledge Base page; Agent detail → Knowledge Base tab.

GET/api/v1/knowledge_base/list

List files

UI: Knowledge Base page → file list; Agent KB tab → available files

Response: { success, data: { files[] } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/v1/knowledge_base/list" \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/api/v1/knowledge_base/can_upload

Check if upload allowed

UI: Knowledge Base page → before upload

Body: {"file_size":"number","file_type":"string"}

Response: { success, data: { allowed } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/v1/knowledge_base/can_upload" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"file_size":1024,"file_type":"pdf"}'
POST/api/v1/knowledge_base/create

Upload PDF file

UI: Knowledge Base page → upload; Agent KB tab → upload

Body: {"file_data":"base64 (required)","filename":"string (required, must end with .pdf)"}

Response: { success, data: { file } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/v1/knowledge_base/create" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"file_data":"BASE64_ENCODED_CONTENT","filename":"sample.pdf"}'
POST/api/v1/knowledge_base/attach

Attach file(s) to agent

UI: Agent detail → Knowledge Base tab → Attach

Body: {"file_ids":"number[]","agent_id":"string","when_to_use":"string (optional)"}

Response: { success }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/v1/knowledge_base/attach" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"file_ids":[1,2],"agent_id":"AGENT_ID","when_to_use":"Always"}'
POST/api/v1/knowledge_base/detach

Detach file(s) from agent

UI: Agent detail → Knowledge Base tab → Detach

Body: {"file_ids":"number[]","agent_id":"string"}

Response: { success }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/v1/knowledge_base/detach" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"file_ids":[1],"agent_id":"AGENT_ID"}'
POST/api/v1/knowledge_base/delete

Delete file

UI: Knowledge Base page → delete file

Body: {"file_id":"number"}

Response: { success }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/v1/knowledge_base/delete" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"file_id":1}'

Integrations

Custom API and Cal.com integrations; attach/detach to agents.

Used in UI: Dashboard → Integrations page; Agent detail → Integrations tab.

GET/api/integrations

List integrations

UI: Integrations page → Your integrations; Agent Integrations tab → dropdown

Response: { success, data: { integrations[] } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/integrations" \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/api/integrations/custom-api

Create custom API integration

UI: Integrations page → Create Custom API form

Body: "name, description, url, method, headers[], query_params[], body_params[], body_type, integration_type: \"custom_api\""

Response: { success, data: { id, ... } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/integrations/custom-api" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"My API","description":"Look up order status from our backend","url":"https://api.example.com/orders","method":"POST","headers":[],"query_params":[],"body_params":[{"key":"order_id","description":"Order ID from the caller","type":"string","required":true,"isLLMGenerated":true}],"body_type":"json","integration_type":"custom_api"}'
POST/api/integrations/test-connection

Test a Custom API endpoint before saving

UI: Integrations → Custom API → Test tab

Body: "url, method, headers[], query_params[], body_params[], sample_params"

Response: { success, data: { ok, status, requestUrl, bodyPreview } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/integrations/test-connection" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://api.example.com/orders","method":"GET","query_params":[{"key":"order_id"}],"sample_params":{"order_id":"123"}}'
POST/api/integrations/cal

Create Cal.com integration

UI: Integrations page → Cal.com form

Body: "name, description, cal_api_key, cal_id, cal_timezone, integration_type: \"cal\""

Response: { success, data: { id, ... } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/integrations/cal" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"My Cal","cal_api_key":"cal_xxx","cal_id":"user_xxx","cal_timezone":"America/New_York","integration_type":"cal"}'

Calls

Dispatch calls, list logs, bulk campaigns (create, pause, resume, reschedule, cancel).

Used in UI: Dashboard → Recent Calls; Quick Call; Agent detail → Recent Calls tab; Bulk Campaigns page.

POST/api/calls/dispatch

Start a call

UI: Quick Call, Agent web call, programmatic outbound

Body: "agent_id, to_number, from_number_id (optional), etc."

Response: { success, data: { call_id, ... } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/calls/dispatch" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"agent_id":"AGENT_ID","to_number":"+15551234567"}'
GET/api/calls/logs

List call logs

UI: Recent Calls page; Agent detail → Recent Calls tab

Query: "pageno, pagesize, agentid (optional)"

Response: { success, data: { call_logs[] / call_log_data, ... } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/calls/logs?pageno=1&pagesize=20" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/calls/logs/:callLogId

Get call log

UI: Recent Calls → row click / detail

Response: { success, data: { call log } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/calls/logs/CALL_LOG_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/calls/bulk

List bulk campaigns

UI: Bulk Campaigns page → list

Query: "pageno, pagesize, status (optional)"

Response: { success, data: { records[], total_records } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/calls/bulk?pageno=1&pagesize=20" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/calls/bulk/:bulkId

Get bulk campaign

UI: Bulk Campaigns page → campaign detail

Response: { success, data: { campaign } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/calls/bulk/BULK_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/api/calls/bulk

Create bulk campaign

UI: Bulk Campaigns page → Create New Campaign form

Body: "name, from_number_id or phone_number_id, contacts[] or contact_list[], is_scheduled, scheduled_datetime, timezone, retry_config{}, enabled_reschedule_call, concurrent_call_limit"

Response: { success, data: { id, ... } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/calls/bulk" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Campaign","from_number_id":"pn_xxx","contacts":[{"phone":"+15551234567","name":"John"}],"is_scheduled":false,"retry_config":{"auto_retry":true,"retry_limit":2},"concurrent_call_limit":1}'
PUT/api/calls/bulk/:bulkId

Pause / Resume / Reschedule

UI: Bulk Campaigns page → Pause, Resume, Reschedule buttons

Body: "action: \"pause\" | \"resume\" | \"reschedule\"; for reschedule: new_scheduled_datetime, new_timezone"

Response: { success, data }

Example
curl -X PUT "https://bkbharatai.blutec.ai/api/calls/bulk/BULK_ID" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"pause"}'
DELETE/api/calls/bulk/:bulkId

Cancel bulk campaign

UI: Bulk Campaigns page → Cancel button

Response: { success }

Example
curl -X DELETE "https://bkbharatai.blutec.ai/api/calls/bulk/BULK_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"

Billing & Balance

Plans, balance, usage-based billing toggle.

Used in UI: Dashboard → Balance & Plans page.

GET/api/billing/plans

List plans

UI: Balance & Plans → plans list

Response: { success, data: { plans[] } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/billing/plans" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/billing/balance

Get balance

UI: Balance & Plans → balance display

Response: { success, data: { balance, ... } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/billing/balance" \
  -H "Authorization: Bearer YOUR_TOKEN"
PUT/api/billing/usage-based

Toggle usage-based billing

UI: Balance & Plans → usage-based toggle

Body: {"enabled":"boolean"}

Response: { success }

Example
curl -X PUT "https://bkbharatai.blutec.ai/api/billing/usage-based" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'

API Keys

Create and list API keys for server-side or script access.

Used in UI: Dashboard → API Access page.

GET/api/api-keys

List API keys

UI: API Access page → keys list

Response: { success, data: { keys[] } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/api-keys" \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/api/api-keys

Create API key

UI: API Access page → Create key

Body: {"name":"string (optional)"}

Response: { success, data: { key, id, ... } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/api-keys" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"My Key"}'
DELETE/api/api-keys/:id

Delete API key

UI: API Access page → Delete key

Response: { success }

Example
curl -X DELETE "https://bkbharatai.blutec.ai/api/api-keys/KEY_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"

Phone Numbers

List, create, assign/detach to agents. Used for outbound/inbound caller ID.

Used in UI: Agent detail (from number), Bulk Campaigns (from number). Phone Numbers page if enabled.

GET/api/phone-numbers

List my numbers

UI: Bulk Campaigns → From number dropdown; Agent config (from number)

Response: { success, data: { phoneNumbers[] } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/phone-numbers" \
  -H "Authorization: Bearer be_your_api_key"
GET/api/phone-numbers/upstream

List upstream (provider) numbers

UI: Phone Numbers page → upstream list (if used)

Query: "pageno, pagesize"

Response: { success, data: { upstreamPhoneNumbers[] } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/phone-numbers/upstream?pageno=1&pagesize=20" \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/api/phone-numbers

Create / add number

UI: Phone Numbers page → add number

Body: "number, country_code, provider, label, external_id (optional)"

Response: { success, data: { phoneNumber } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/phone-numbers" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"number":"+15551234567","country_code":"+1","provider":"blutec"}'
POST/api/phone-numbers/from-upstream

Add from upstream provider

UI: Phone Numbers page → import from provider

Body: {"phone_number_id":"number","phone_number":"string","label":"optional"}

Response: { success, data: { phoneNumber } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/phone-numbers/from-upstream" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"phone_number_id":123,"phone_number":"+15551234567"}'
POST/api/phone-numbers/import-twilio

Import Twilio number via OmniDimension

UI: Phone Numbers page → Import from Twilio

Body: "phone_number, account_sid, account_token, name (optional)"

Response: { success, data: { phoneNumber } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/phone-numbers/import-twilio" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"phone_number":"+15551234567","account_sid":"AC...","account_token":"...","name":"Support Line"}'
POST/api/phone-numbers/import-sip

Import SIP trunk via OmniDimension

UI: Phone Numbers page → Import SIP trunk

Body: "phone_number, sip_host, sip_trunk_name, name, sip_port, sip_username, sip_password, sip_dial_prefix, sip_strip_plus (optional)"

Response: { success, data: { phoneNumber } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/phone-numbers/import-sip" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"phone_number":"+15551234567","sip_host":"sip.provider.com","sip_trunk_name":"my-trunk","sip_port":5060}'
POST/api/phone-numbers/:id/assign

Assign number to agent

UI: Phone Numbers page → assign to agent

Body: {"agent_id":"string"}

Response: { success }

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

Detach number from agent

UI: Phone Numbers page → detach

Response: { success }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/phone-numbers/PN_ID/detach" \
  -H "Authorization: Bearer YOUR_TOKEN"
DELETE/api/phone-numbers/:id

Remove number

UI: Phone Numbers page → delete

Response: { success }

Example
curl -X DELETE "https://bkbharatai.blutec.ai/api/phone-numbers/PN_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"

Providers (Voices, STT, TTS)

List voices, STT and TTS providers. Used by Agent config (voice, transcriber) and modals.

Used in UI: Agent detail → Call Config (voice, STT); Voice/LLM/STT modals.

GET/api/providers/voices

List voices

UI: Voice modal → voice list (with pagination/filters)

Query: "provider, language, page, page_size, ..."

Response: { success, data: { voices[] } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/providers/voices?provider=eleven_labs" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/providers/voice/:id

Get voice

UI: Voice modal → single voice detail

Response: { success, data: { voice } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/providers/voice/VOICE_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/providers/stt

List STT providers

UI: STT modal → provider list

Response: { success, data: { providers[] } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/providers/stt" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/providers/tts

List TTS providers

UI: TTS / Voice modal → provider list

Response: { success, data }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/providers/tts" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/providers/all

All providers (STT + TTS + models)

UI: LLM/STT modals → combined list

Response: { success, data }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/providers/all" \
  -H "Authorization: Bearer YOUR_TOKEN"

Analytics

Summary metrics for calls and usage.

Used in UI: Dashboard → Analytics page.

GET/api/analytics/summary

Analytics summary

UI: Analytics page

Response: { success, data: { summary } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/analytics/summary" \
  -H "Authorization: Bearer YOUR_TOKEN"

Demo (Public)

Landing page "Try Echo" — trigger a call without auth.

Used in UI: Landing page → Try Echo form.

GET/api/demo/status(no auth)

Demo available

UI: Landing → check if demo is enabled

Response: { success, data: { available } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/demo/status"
POST/api/demo/dispatch(no auth)

Trigger demo call

UI: Landing → Try Echo → submit phone number

Body: {"to_number":"string","country_code":"string (optional)","industry":"string (optional industry slug; omit to use master agent)"}

Response: { success, data }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/demo/dispatch" \
  -H "Content-Type: application/json" \
  -d '{"to_number":"15551234567","country_code":"1"}'

Admin

User management, master agent, limits. Requires is_admin.

Used in UI: Dashboard (admin) → Admin, Users.

GET/api/admin/overview

Admin overview

UI: Admin dashboard

Response: { success, data }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/admin/overview" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/admin/users

List users

UI: Admin → Users list

Response: { success, data: { users[] } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/admin/users" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/admin/users/:userId

Get user

UI: Admin → User detail

Response: { success, data: { user } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/admin/users/USER_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/api/admin/users

Create user

UI: Admin → Create user

Body: "email, password, name, ..."

Response: { success, data: { user } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/admin/users" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email":"u@example.com","password":"pass","name":"User"}'
PUT/api/admin/users/:userId

Update user

UI: Admin → Edit user

Body: "Partial user object"

Response: { success }

Example
curl -X PUT "https://bkbharatai.blutec.ai/api/admin/users/USER_ID" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"New Name"}'
DELETE/api/admin/users/:userId

Delete user

UI: Admin → Delete user

Response: { success }

Example
curl -X DELETE "https://bkbharatai.blutec.ai/api/admin/users/USER_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/api/admin/master-agent

Get master agent

UI: Dashboard → Set Master Agent

Response: { success, data: { master_agent_id } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/admin/master-agent" \
  -H "Authorization: Bearer YOUR_TOKEN"
PUT/api/admin/master-agent

Set master agent

UI: Dashboard → Set Master Agent link

Body: {"master_agent_id":"string"}

Response: { success }

Example
curl -X PUT "https://bkbharatai.blutec.ai/api/admin/master-agent" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"master_agent_id":"AGENT_ID"}'
GET/api/admin/demo-industry-agents

Get industry demo agent mappings

UI: Admin → Industry demo agents

Response: { success, data: { mappings } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/admin/demo-industry-agents" \
  -H "Authorization: Bearer YOUR_TOKEN"
PUT/api/admin/demo-industry-agents

Set industry demo agent mappings

UI: Admin → Industry demo agents

Body: {"mappings":"{ [industrySlug]: agentId }"}

Response: { success, data: { mappings } }

Example
curl -X PUT "https://bkbharatai.blutec.ai/api/admin/demo-industry-agents" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mappings":{"healthcare":"AGENT_ID"}}'
GET/api/admin/users/:userId/limits

Get user limits

UI: Admin → User limits

Response: { success, data: { limits } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/admin/users/USER_ID/limits" \
  -H "Authorization: Bearer YOUR_TOKEN"
PUT/api/admin/users/:userId/limits

Update user limits

UI: Admin → Edit user limits

Body: "maxAgents, etc."

Response: { success }

Example
curl -X PUT "https://bkbharatai.blutec.ai/api/admin/users/USER_ID/limits" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"maxAgents":5}'
GET/api/admin/agents

List all agents (admin)

UI: Admin → agents overview

Response: { success, data: { agents[] } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/admin/agents" \
  -H "Authorization: Bearer YOUR_TOKEN"

Voice Sessions

Create a short-lived voice session (server-side). The client then connects to the returned ws_url using the OmniDim web SDK or the raw WebSocket protocol. API keys never leave the server. See also realtime streaming and errors guidance.

Used in UI: Agent detail → Deploy → Web voice session.

POST/api/sessions/create

Create voice session

UI: Agent → Deploy → Web voice session → Start session

Body: {"agent_id":"string|number (required)","type":"voice","custom_variables":"object (optional)"}

Response: { success, data: { session: { session_id, token, expires_at, ws_url } } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/sessions/create" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"agent_id":158910,"type":"voice","custom_variables":{"name":"Demo User"}}'

Simulations

Scenario-based agent testing: list, create, get, update, delete, start, stop, and enhance prompt. Proxies OmniDimension /simulations APIs.

Used in UI: Dashboard → Simulations.

GET/api/simulations

List simulations

UI: Simulations page list

Query: {"pageno":"number","pagesize":"number (max 150)"}

Response: { success, data: { records[], total_records } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/simulations?pageno=1&pagesize=10" \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/api/simulations

Create simulation

UI: Simulations → New simulation

Body: {"name":"string","agent_id":"number","number_of_call_to_make":"1-3","concurrent_call_count":"1-3","max_call_duration_in_minutes":"1-10","scenarios":"[{ name, description, expected_result, selected_voices[] }]"}

Response: { success, data: { simulation } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/simulations" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"My Simulation","agent_id":158910,"scenarios":[{"name":"Polite cancellation","description":"Ask to cancel, be friendly.","expected_result":"Agent routes to retention.","selected_voices":[{"provider":"eleven_labs"}]}]}'
GET/api/simulations/:id

Get simulation

UI: Simulations → Details panel

Response: { success, data: { simulation } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/simulations/456" \
  -H "Authorization: Bearer YOUR_TOKEN"
PUT/api/simulations/:id

Update simulation

UI: Simulations → Details → Save

Body: "name, agent_id, number_of_call_to_make, concurrent_call_count, max_call_duration_in_minutes, scenarios[]"

Response: { success, data: { simulation } }

Example
curl -X PUT "https://bkbharatai.blutec.ai/api/simulations/456" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Updated Simulation","max_call_duration_in_minutes":5}'
DELETE/api/simulations/:id

Delete simulation

UI: Simulations → Delete

Response: { success }

Example
curl -X DELETE "https://bkbharatai.blutec.ai/api/simulations/456" \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/api/simulations/:id/start

Start simulation

UI: Simulations → Start

Body: {"scenarios":"optional array to update before start"}

Response: { success, data }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/simulations/456/start" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
POST/api/simulations/:id/stop

Stop simulation

UI: Simulations → Stop

Response: { success, data }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/simulations/456/stop" \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/api/simulations/:id/enhance-prompt

Enhance prompt from simulation results

UI: Simulations → Enhance prompt

Response: { success, data: { previous_context[], prompt_breakdown[] } }

Example
curl -X POST "https://bkbharatai.blutec.ai/api/simulations/456/enhance-prompt" \
  -H "Authorization: Bearer YOUR_TOKEN"

Realtime & Errors

Realtime voice streaming is handled inside calls/sessions. For campaign progress, poll live-status. Upstream errors use { error, error_description }; call endpoints may use { success: false, plan_expire }. Retry 429/5xx with backoff; do not blind-retry dispatch.

Used in UI: Bulk Campaigns live progress; Session voice modal; API error handling.

GET/api/calls/bulk/:bulkId/live-status

Bulk campaign live status

UI: Bulk Campaigns → poll while running

Response: { success, data: { campaign_status, summary{ total_contacts, queued, in_progress, completed, failed, ... } } }

Example
curl -X GET "https://bkbharatai.blutec.ai/api/calls/bulk/BULK_ID/live-status" \
  -H "Authorization: Bearer YOUR_TOKEN"

Next steps

Start with Getting Started, then explore individual API pages for deeper configuration options.