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.

1. Find your workspace
curl https://calldesk.tech/api/v1/me \
  -H "Authorization: Bearer cdk_live_..."
2. Create an agent from a template
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

get/me

Who 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

get/tenants/{tenantId}/agents

List agents

Each agent includes its latest version’s engine/voice and any routed phone numbers.

Returns { agents: Agent[] }

post/tenants/{tenantId}/agents

Create an agent

name*
string
mode
'simple' | 'advanced'

Returns { agent }

get/agents/{agentId}

Get an agent

Returns { agent }

patch/agents/{agentId}

Rename an agent

name
string

Returns { agent }

delete/agents/{agentId}

Delete an agent

Also deletes its versions, subflows and knowledge bases.

Returns { success }

get/agents/{agentId}/versions

List versions

Returns { versions: AgentVersion[] }

post/agents/{agentId}/versions

Publish 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 }

get/agent-templates

List 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) }[] }

post/tenants/{tenantId}/agents/from-template

Create 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

get/tenants/{tenantId}/subflows

List subflows

?agentId Only library subflows plus this agent’s own

Returns { subflows: Subflow[] }

post/tenants/{tenantId}/subflows

Create a subflow

name*
string
scope
'agent' | 'library'
agentId
string (agent scope)
nodes
FlowNode[]
startNodeId
string

Returns { subflow }

get/tenants/{tenantId}/subflows/{subflowId}

Get a subflow

Returns { subflow }

patch/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 }

delete/tenants/{tenantId}/subflows/{subflowId}

Delete a subflow

Returns { ok }

Knowledge bases

get/tenants/{tenantId}/knowledge-bases

List knowledge bases

Returns { knowledgeBases }

post/tenants/{tenantId}/knowledge-bases

Create 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 }

patch/knowledge-bases/{knowledgeBaseId}

Rename or re-attach to an agent

name
string
agent_id
string | null

Returns { knowledgeBase }

delete/knowledge-bases/{knowledgeBaseId}

Delete a knowledge base

Returns { success }

get/knowledge-bases/{knowledgeBaseId}/items

List Q&A items

Returns { items }

post/knowledge-bases/{knowledgeBaseId}/items

Add Q&A items

items*
{ question: string, answer: string }[]

Returns { items }

Phone numbers

get/tenants/{tenantId}/phone-numbers

List phone numbers

Returns { phoneNumbers }

post/phone-numbers/{phoneNumberId}/routing

Route a number to an agent version

direction*
'inbound' | 'outbound'
agentVersionId
string | null

Returns { phoneNumber }

Calls

post/phone-numbers/{phoneNumberId}/call

Place 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 } }

get/tenants/{tenantId}/calls

List calls

?limit default 50

Returns { callLogs: CallLog[] }

get/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 }

get/calls/{callId}/recording

Stream a call recording

Returns audio

Batch calls

get/tenants/{tenantId}/batch-calls

List batch calls

Returns { batches }

post/tenants/{tenantId}/batch-calls

Create a batch

agentVersionId*
string
phoneNumbers*
string[] (E.164)

Returns { batch }

post/batch-calls/{batchId}/run

Start a batch

Dials paced by the platform-wide and per-workspace rate limits.

Returns { started, ... }

Webhooks

get/tenants/{tenantId}/webhooks

List webhooks

Returns { webhooks }

post/tenants/{tenantId}/webhooks

Register 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 }

patch/tenants/{tenantId}/webhooks/{webhookId}

Update a webhook

url
string
events
string[]
enabled
boolean

Returns { webhook }

delete/tenants/{tenantId}/webhooks/{webhookId}

Delete a webhook

Returns { success }

post/tenants/{tenantId}/webhooks/{webhookId}/test

Send a test delivery

Returns { ok }

Contacts

get/tenants/{tenantId}/contacts

List contacts

Returns { contacts }

Analytics

get/tenants/{tenantId}/analytics

Call analytics by day

?days 7 | 30 | 90

Returns { series, totals }

Quality

get/tenants/{tenantId}/qa/overview

QA scores, resolution and transfer metrics

?days 7 | 30 | 90

Returns { avgScore, resolutionRate, transferSuccessRate, ... }

get/agents/{agentId}/test-cases

List simulation test cases

Returns { testCases }

post/agents/{agentId}/test-cases

Create a test case

name
string
persona
string
successCriteria
string

Returns { testCase }

post/agents/{agentId}/test-cases/{testCaseId}/run

Run a simulation

Returns { passed, transcript, reasoning }