API reference
Build on CallDeskTech.
Build, publish and operate voice agents. Authenticate with Authorization: Bearer cdk_live_… (create keys in Settings → API Keys). A key is pinned to one workspace; call GET /me to get its tenant id.
Quick start
Send your key as a bearer token. Ask who it belongs to first: the response includes the workspace id used in the paths below.
curl https://calldesk.tech/api/v1/me \
-H "Authorization: Bearer cdk_live_..."curl -X POST \
https://calldesk.tech/api/v1/tenants/$TENANT/agents/from-template \
-H "Authorization: Bearer cdk_live_..." \
-H "Content-Type: application/json" \
-d '{"templateId": "medical-receptionist"}'Errors return 401 for missing or bad credentials, 404 for anything outside your workspace, and 429 when rate limited.
Account
/meWho am I?
For an API key, returns the tenant it is pinned to — use that id in the paths below.
Returns { auth, tenantId, tenantName }
Agents
/tenants/{tenantId}/agentsList agents
Each agent includes its latest version’s engine/voice and any routed phone numbers.
Returns { agents: Agent[] }
/tenants/{tenantId}/agentsCreate an agent
name*- string
mode- 'simple' | 'advanced'
Returns { agent }
/agents/{agentId}Get an agent
Returns { agent }
/agents/{agentId}Rename an agent
name- string
Returns { agent }
/agents/{agentId}Delete an agent
Also deletes its versions, subflows and knowledge bases.
Returns { success }
/agents/{agentId}/versionsList versions
Returns { versions: AgentVersion[] }
/agents/{agentId}/versionsPublish a new version
Versions are immutable. nodes is the conversation-flow graph; subflow_ref nodes are embedded as snapshots at publish time.
flowName*- string
startNodeId*- string
nodes*- FlowNode[]
globalSettings- object
voiceEngine*- 'poc' | 'retell'
voiceId- string
ttsBackend- 'kokoro' | 'elevenlabs' | 'cartesia' | 'minimax'
Returns { version, flow }
/agent-templatesList agent templates
Built-in templates (receptionist, medical receptionist, payment collection, IVR navigation and more) that can be installed as an agent.
Returns { templates: { id, label, description, category, defaultVariables: {name: value}, variables: string[] (the {{placeholders}} you can set on install) }[] }
/tenants/{tenantId}/agents/from-templateCreate an agent from a template
Creates the agent, its subflows and knowledge base, and publishes version 1. voiceEngine "poc" runs on CallDesk; "retell" also creates the equivalent Retell conversation-flow agent (some node types are approximated; see warnings). transferTo and functionUrl fill empty transfer numbers and function webhooks. variables sets the template's {{placeholders}} (see GET /agent-templates); business_name defaults to the tenant name.
templateId*- string (from GET /agent-templates)
name- string
voiceEngine- 'poc' | 'retell'
transferTo- E.164 string
functionUrl- https URL
calendarTools- false to turn off live calendar lookups and bookings
variables- object, e.g. {"business_name": "Acme Dental", "agent_name": "Sam"}
Returns { agentId, versionId, versionNumber, template, voiceEngine, retellAgentId?, warnings? }
Subflows
/tenants/{tenantId}/subflowsList subflows
?agentId Only library subflows plus this agent’s own
Returns { subflows: Subflow[] }
/tenants/{tenantId}/subflowsCreate a subflow
name*- string
scope- 'agent' | 'library'
agentId- string (agent scope)
nodes- FlowNode[]
startNodeId- string
Returns { subflow }
/tenants/{tenantId}/subflows/{subflowId}Get a subflow
Returns { subflow }
/tenants/{tenantId}/subflows/{subflowId}Update a subflow
Already-published versions keep the snapshot they embedded.
name- string
nodes- FlowNode[]
startNodeId- string
scope- string
Returns { subflow }
/tenants/{tenantId}/subflows/{subflowId}Delete a subflow
Returns { ok }
Knowledge bases
/tenants/{tenantId}/knowledge-basesList knowledge bases
Returns { knowledgeBases }
/tenants/{tenantId}/knowledge-basesCreate a knowledge base
Set agent_id — a knowledge_base node only sees content from a KB attached to its agent.
name*- string
source_type*- 'website' | 'pdf' | 'manual'
source_url- string
agent_id- string
Returns { knowledgeBase }
/knowledge-bases/{knowledgeBaseId}Rename or re-attach to an agent
name- string
agent_id- string | null
Returns { knowledgeBase }
/knowledge-bases/{knowledgeBaseId}Delete a knowledge base
Returns { success }
/knowledge-bases/{knowledgeBaseId}/itemsList Q&A items
Returns { items }
/knowledge-bases/{knowledgeBaseId}/itemsAdd Q&A items
items*- { question: string, answer: string }[]
Returns { items }
Phone numbers
/tenants/{tenantId}/phone-numbersList phone numbers
Returns { phoneNumbers }
/phone-numbers/{phoneNumberId}/routingRoute a number to an agent version
direction*- 'inbound' | 'outbound'
agentVersionId- string | null
Returns { phoneNumber }
Calls
/phone-numbers/{phoneNumberId}/callPlace an outbound call
Calls toNumber from this number using its outbound agent. Rate-limited per workspace (429).
toNumber*- E.164 string
Returns { call: { sid, to } }
/tenants/{tenantId}/callsList calls
?limit default 50
Returns { callLogs: CallLog[] }
/calls/{callId}Get a call
Includes transcript, outcome, duration, transfer status, and analysis (post-call analysis fields, null unless configured on the agent).
Returns { callLog }
/calls/{callId}/recordingStream a call recording
Returns audio
Batch calls
/tenants/{tenantId}/batch-callsList batch calls
Returns { batches }
/tenants/{tenantId}/batch-callsCreate a batch
agentVersionId*- string
phoneNumbers*- string[] (E.164)
Returns { batch }
/batch-calls/{batchId}/runStart a batch
Dials paced by the platform-wide and per-workspace rate limits.
Returns { started, ... }
Webhooks
/tenants/{tenantId}/webhooksList webhooks
Returns { webhooks }
/tenants/{tenantId}/webhooksRegister a webhook
Events: call.started (Retell-engine calls only), call.completed (includes analysis when configured), call.transferred, call.analyzed (post-call analysis results). Deliveries are signed with the returned whsec_ secret (X-CallDesk-Event header names the event).
url*- https URL
events- ('call.started' | 'call.completed' | 'call.transferred' | 'call.analyzed')[]
Returns { webhook }
/tenants/{tenantId}/webhooks/{webhookId}Update a webhook
url- string
events- string[]
enabled- boolean
Returns { webhook }
/tenants/{tenantId}/webhooks/{webhookId}Delete a webhook
Returns { success }
/tenants/{tenantId}/webhooks/{webhookId}/testSend a test delivery
Returns { ok }
Contacts
/tenants/{tenantId}/contactsList contacts
Returns { contacts }
Analytics
/tenants/{tenantId}/analyticsCall analytics by day
?days 7 | 30 | 90
Returns { series, totals }
Quality
/tenants/{tenantId}/qa/overviewQA scores, resolution and transfer metrics
?days 7 | 30 | 90
Returns { avgScore, resolutionRate, transferSuccessRate, ... }
/agents/{agentId}/test-casesList simulation test cases
Returns { testCases }
/agents/{agentId}/test-casesCreate a test case
name- string
persona- string
successCriteria- string
Returns { testCase }
/agents/{agentId}/test-cases/{testCaseId}/runRun a simulation
Returns { passed, transcript, reasoning }