API reference
Calls
How these fit together: the Calls guide.
List calls
get
Lists calls newest first, or — with updatedAfter — every change since, oldest first.
Every call of the organization in the key’s mode (a test key lists test calls only), whichever path placed it, filtered by status, direction, contactId and a createdAfter/createdBefore window. Root calls only by default: include=legs adds the legs dialled from live calls, and rootCallId returns one call’s graph. With updatedAfter it returns every call changed since instead, oldest change first with a cursor of its own, holding back the last two minutes of changes until nothing stamped earlier can still commit — page it to reconcile what your webhooks missed, deduplicating on id + status.
Access: an organization key with the calls:read scope.
Query parameters
limitintegerHow many items to return.
cursorstringThe
nextCursorof the previous page. Omit for the first page.statusstringOne of
queuedinitiatingringingin_progressendingcompletedbusyno_answercancelledfailedcontactIdstring (uuid)directionstringOne of
inboundoutboundcreatedAfterstring (date-time)Only calls created at or after this instant.
createdBeforestring (date-time)Only calls created before this instant.
updatedAfterstring (date-time)Reconciliation: calls whose
updatedAtis at or after this instant, OLDEST change first (byupdatedAt, thenid). Changes from the last 2 minutes are held back until no earlier-stamped change can still commit, so nothing before the last one served is ever skipped. Page withnextCursor; when it is null, resume later from the lastupdatedAtyou saw and dedupe byid+status.includestringlegsalso lists the legs dialled from live calls (transfer targets, conference parties, bridged numbers —parentCallIdset). Omitted: root calls only.One of
legsrootCallIdstring (uuid)Only the calls of this call graph (its root and every leg dialled from it). Implies
include=legs.metadatastring[]Calls whose
metadataholds this key with exactly this value, writtenkey:value(the first:splits; values may contain more) — a/v1call’s ownmetadata, or themetadataof the number an inbound call came in on. Repeat the parameter for up to 5 pairs — every one must match. Combines with every other filter and withupdatedAfter. Indexed, so it is as cheap as the plain list.
Response 200PublicCallPage
dataPublicCall[]RequiredIts fields are listed under Get call
nextCursorstring | nullRequiredPass back as
cursorfor the next page; null on the last.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/calls?status=completed&limit=50' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"data": [
{
"agent": {
"audio": {
"encoding": "pcm_s16le",
"sampleRate": 16000
},
"maxDurationSec": 1,
"streamUrl": "STREAM_URL"
},
"aiAgentId": "AI_AGENT_ID",
"answeredAt": "2026-11-05T10:00:00.000Z",
"bridge": {
"agentMembershipId": "AGENT_MEMBERSHIP_ID",
"numberLast4": "0000",
"phoneId": "PHONE_ID",
"ringFirst": "contact",
"target": "number"
},
"charge": {
"amountMinor": 180,
"chargedMinutes": 3,
"currency": "INR",
"includedMinutes": 0,
"ratePerMinuteMinor": 60,
"ratedAt": "2026-11-05T10:00:00.000Z",
"reason": null,
"rule": null,
"status": "charged"
},
"contactId": "CONTACT_ID",
"createdAt": "2026-11-05T10:00:00.000Z",
"direction": "inbound",
"durationSeconds": 1,
"endedAt": "2026-11-05T10:00:00.000Z",
"failure": {
"code": "NO_ANSWER",
"reason": "REASON"
},
"flow": {
"applicationId": "APPLICATION_ID",
"callFlowId": "CALL_FLOW_ID",
"source": "definition"
},
"from": "+918031152580",
"fromSource": "organization_number",
"hangup": {
"apiKeyId": "API_KEY_ID",
"reason": "api-hangup",
"side": "agent"
},
"id": "ID",
"initiatedAt": "2026-11-05T10:00:00.000Z",
"legRole": "primary",
"livemode": true,
"machineDetection": {
"detectedAt": "2026-11-05T10:00:00.000Z",
"mode": "detect",
"result": "human"
},
"metadata": {},
"mode": "external_agent",
"numberId": "NUMBER_ID",
"object": "call",
"parentCallId": "PARENT_CALL_ID",
"provider": "airtel",
"purpose": "service",
"recording": {
"durationSeconds": 1,
"expiresAt": "EXPIRES_AT",
"format": "audio/mpeg",
"id": "ID",
"noticePlayed": true,
"purpose": "call",
"status": "pending",
"url": "URL"
},
"recordingEnabled": true,
"reference": "REFERENCE",
"ringingAt": "2026-11-05T10:00:00.000Z",
"rootCallId": "ROOT_CALL_ID",
"status": "queued",
"to": "•••• ••3210",
"updatedAt": "2026-11-05T10:00:00.000Z"
}
],
"nextCursor": "NEXT_CURSOR"
}Create call
post
Places a call run by your agent’s stream, a call flow, an AI agent, or bridged to a number or agent.
Dials one contact — contactId, or to.phone, which finds or creates the contact and so also needs contacts:write — and answers with the call: queued, or initiating once the carrier has the dial; what follows arrives as call.* events (call.ringing, call.answered, call.completed, …) or from GET /v1/calls/{callId}. Send an Idempotency-Key on every attempt you might retry: a retry answers the call it placed and never dials twice. The main refusals come before anything rings — 402 BILLING_INSUFFICIENT_CREDIT (the balance must cover maxDurationSec beside the live calls already in flight, each at its own ceiling and rate; maxDurationSecAvailable names the longest call that fits now, when one does), 409 CONTACT_DO_NOT_CALL or CALLING_WINDOW_CLOSED, 422 DESTINATION_BLOCKED, 429 CALL_CONCURRENCY_LIMIT — and 502 CARRIER_REJECTED when the carrier refuses the dial (the call reads failed; a retry dials afresh). A test key’s call is held to the same rules but never reaches a carrier, the wallet or the contact: the sandbox plays it out by the number’s last four digits (0002 busy, 0003 no answer, 0005 failed, any other answered).
Access: an organization key with the calls:write scope.
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. This endpoint converges when run again, so a 5xx stores nothing either: a retry with the same key runs it again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
agentPublicCallAgentRequestRequired with
mode: EXTERNAL_AGENT(a request without it is400), refused with any other mode.3 fields of
agentaudioPublicCallAgentAudioRequired2 fields of
audioencodingstringRequiredOne of
pcm_s16lesampleRateintegerRequiredOne of
16000
streamUrlstringRequiredThe WebSocket the platform opens when the contact answers.
wss://on a public host; checked when the call is requested and again when the socket connects.at most 2048 characters
tokenstringRequiredSent as
Authorization: Bearer <token>on the upgrade. Opaque to the platform, stored sealed, never returned.at most 512 characters
aiAgentPublicCallAiAgentRequestRequired with
mode: AI_AGENT, refused with any other mode.9 fields of
aiAgentagentIdstring (uuid)RequiredOne of the organization’s AI agents (
GET /v1/agents): its voice, model and instructions run the conversation.firstMessagestringWhat the agent says first, word for word, in place of its own first message (the agent then speaks first). Stored sealed with the call: it may name the person.
1–1000 characters
instructionsstringThe agent’s instructions for this call, in place of its own (its language and the call’s
objectiveare still added). Stored sealed with the call.1–20000 characters
objectivestringWhat this call is for, added to the agent’s instructions. Never personal data beyond what the conversation needs: it is stored with the call.
at most 2000 characters
onMachinestringT5 —
hangup: when the carrier says an answering machine answered, the call ends without a word. The agent waits for the verdict (at most 6 seconds after the answer, silence meanwhile) before it speaks; a verdict that comes later still ends the call at once. ImpliesmachineDetection: detectwhen the request names none (a channel without machine detection is422 MACHINE_DETECTION_UNSUPPORTED).continue(default): the agent speaks to whoever answered. In test mode the verdict issandbox.machine.One of
continuehangupdefault "continue"
optOutPublicAiOptOutThe built-in opt-out: the caller presses
keyor says one ofphrases, and at once the contact is marked do-not-call (call.ai.opt_outtells it), the agent saysreplyand the call ends. A key or phrases, or both.3 fields of
optOutkeystringThe key that opts the caller out.
One of
0123456789*#phrasesstring[]Phrases that opt the caller out when they say one (2–120 characters each; matched ignoring case and punctuation, on word boundaries).
at most 10 items
replystringSaid to the caller, in the agent’s voice, before the call ends.
at most 500 charactersdefault "Understood. We will not call you again. Goodbye."
sessionPublicAgentSessionYour session webhook, asked when the conversation starts for its first message, instructions, tools and options. Needs an agent with a tool-signing secret (
422 AGENT_TOOL_SECRET_REQUIRED).2 fields of
sessiontimeoutSecondsintegerHow long the caller may wait for your answer, in seconds. They hear silence meanwhile.
1–10default 5
urlstringRequiredYour HTTPS endpoint, asked once when the conversation starts: a POST of
{ event: "agent.session", requestId, agentId, callId, source, call, timestamp }(source:call,number_routeorflow_step;callthe tool call’s context), signed with the agent’s tool-signing secret (Trovacast-Signature). Answer2xxJSON (at most 64 KB) with any offirstMessage(null: none),firstSpeaker,instructions,language,endCallPhrases,maxTurns,tools,transferandoptOut— each replaces what the call already had; a field you leave out keeps it. A timeout, a non-2xx or an answer that does not validate is the session being unavailable: the conversation runs on the call’s own options and the agent’s configuration (a flow step can branch instead,onUnavailable). The URL rules of webhook endpoints apply.at most 2048 characters
toolsPublicAiCallTool[]The tools the agent may call on this call, in place of its own — each your HTTPS endpoint, called as an agent’s own tools are (signed with the agent’s tool-signing secret, 4 s, 16 KB). Needs an agent with a tool-signing secret (
422 AGENT_TOOL_SECRET_REQUIRED; rotate one withPOST /v1/agents/{agentId}/tool-secret).at most 10 items
4 fields of
toolsdescriptionstringRequiredWhen the model should use it — the model reads this.
1–1000 characters
namestringRequiredWhat the model calls it: a letter, then letters, digits,
_or-(at most 64). Unique within the call.parametersobjectRequiredThe arguments, as an object schema — the JSON Schema subset an agent’s own tools take (
POST /v1/agents).urlstringRequiredYour HTTPS endpoint, called as an agent’s own tool is: a POST of
{ event: "agent.tool_call", requestId, agentId, callId, toolCallId, tool, arguments, call, timestamp }, signed with the agent’s tool-signing secret, answered2xxwithin 4 seconds. The URL rules of webhook endpoints apply.at most 2048 characters
transferPublicAiTransferA person the agent may hand the caller to: the agent is offered a
transfer_to_persontool, says it is connecting them, and the person rings with the caller on hold. Answered, the person has the caller and the agent leaves; not answered (or busy, or the leg refused), the caller goes back to the agent, which is told why.call.ai.transfersays what came of it. Exactly one ofnumberorphoneId(a route takesphoneIdonly).4 fields of
transfernumberstringAn outside number, international format, rung as a leg of the call (every dial rule applies: the destination policy, the calling window of a called party, billing). On
POST /v1/callsonly — a number’s route names a registered phone (phoneId), so no number is kept in its configuration.phoneIdstring (uuid)One of your own phones (
GET /v1/phones): rung as your staff’s handset (legRole: agent_phone), so the called party’s calling window is not asked of it.ringTimeoutSecondsintegerHow long the person rings before the caller goes back to the agent.
5–120default 30
whisperstringSpoken to the person who answers, before they are connected.
at most 500 characters
bridgePublicCallBridgeRequestRequired with
mode: BRIDGE, refused with any other mode.6 fields of
bridgenoAnswerMessagestringSpoken to the contact when the target does not answer, before the call ends.
at most 500 characters
promptstringSpoken to the contact (speech synthesis) while the target rings.
at most 500 characters
ringFirststringWho is rung first.
contact(default): the contact is dialled, then connected toto.agent(click-to-call,to.agentMembershipIdor — P7 —to.phoneId): the agent’s own phone (a seat’s phone on file, or one of the organization’s/v1/phones) rings first and, once they answer, the contact is dialled and bridged in — the agent hears ringback meanwhile. Every rule a dial meets (do-not-call, the destination policy, the calling window, consent, billing) is the contact’s, asked before the agent is rung; the agent’s phone is held to the destination policy as any number the platform dials, never to the called party’s window. The contact sees the number the call presents (from, else one of the organization’s own numbers, else a seat’s allocated number). Needs a channel that bridges two phone legs (GET /v1/calls/channels:agentFirst) and, for a seat, a phone on file for the agent (422 AGENT_PHONE_REQUIRED); nothing is spoken by the platform, soprompt,whisperandnoAnswerMessageare refused with it.One of
contactagentdefault "contact"
ringTimeoutSecintegerHow long the target rings before the bridge gives up.
5–120default 30
toPublicCallBridgeTargetRequired3 fields of
toagentMembershipIdstring (uuid)A seat in the organization (an organization membership id): the call is offered to that agent’s softphone.
numberstringAn outside number (international format), rung as a leg of the call once the contact answers. Must be on the organization’s list of destinations for connected parties (default: India).
phoneIdstring (uuid)P7 — one of the organization’s own phones (
/v1/phones, of the key’s mode): your staff’s handset, rung by its id so its number never leaves the platform. WithringFirst: agent(staff-first click-to-call) it rings first and the contact is dialled once it answers; otherwise the contact is dialled first and connected to it. Either way it is your staff answering their own handset (legRole: agent_phone), so the called party’s calling window is not asked of it; it must still be a number the organization may dial. A phone that is not one of the organization’s is400 VALIDATION_FAILED.
whisperstringSpoken to the target only, before they are connected (who is calling, why).
at most 500 characters
calledPartyTimeZonestringThe IANA time zone the called party is in, when you know it (their address, their account). The calling windows — this request’s own and, for a +1 number, the TCPA window (
409 DESTINATION_CALLING_WINDOW_CLOSED) — are then asked in that one zone. It is believed only when it keeps the same clock as a zone of the number’s own country: it can pick among a country’s zones, never move the called party out of it. Omitted, or not believed: a +1 number is read in every zone its area code serves, any other number in every zone of its country.contactIdstring (uuid)flowPublicCallFlowRequestRequired with
mode: FLOW, refused with any other mode.4 fields of
flowanswerUrlstringWith
applicationIdonly: ask this URL — on the application’s own origin — for the first instructions instead of the application’s answer URL. Signed with the application’s secret; its fallback URL still applies.at most 2048 characters
applicationIdstring (uuid)A voice application: its answer URL is asked for instructions when the contact answers (signed, 4 s deadline, fallback URL).
callFlowIdstring (uuid)A stored call flow: its published version runs.
definitionobjectAn inline call-flow document (
{ "version": 1, "start": "…", "nodes": { … } }, the grammar ofPOST /v1/call-flows; JSON SchemaCallFlowDocument), validated — grammar, size and every queue, schedule, seat, AI agent and caller ID it names — before anything dials. At most 64 KB.
fromstringThe caller ID the contact sees: one of the organization’s own voice numbers on the call’s channel, international format. Only on a channel with
callerIdSelection(GET /v1/calls/channels); elsewhere422 CALLER_ID_UNSUPPORTED, and a number the organization does not own there422 CALLER_ID_NOT_OWNED. Omitted: the channel’s own caller ID.machineDetectionstringAsk the carrier to tell an answering machine from a person once the call is answered.
detect: the call goes ahead and the verdict arrives ascall.machine_detected(and on the call asmachineDetection.result).detect_and_hangup: the carrier ends the call when a machine answers (failurenames it). Only on a channel withmachineDetection: trueinGET /v1/calls/channels; elsewhere422 MACHINE_DETECTION_UNSUPPORTED. In test mode the verdict is the onesandbox.machinescripts (none, nocall.machine_detected).One of
detectdetect_and_hangupmaxDurationSecintegerRequiredHard ceiling on the conversation from the moment your stream opens (
EXTERNAL_AGENT) — for the other modes, from the moment the call’s audio connects; the platform ends the call at it (stopwith reasonmax_duration, then the hang-up). A media reconnect keeps the original deadline. Bounded by the deployment’s own limit (EXTERNAL_AGENT_MAX_DURATION_SECONDS; by default the carrier time limit less 75 s — 3,525 s with the default hour), above which the request is400. The carrier’s own limit is set 75 s past it, so the prepaid balance must covermaxDurationSec + 75seconds in started minutes beside the organization’s API calls already in flight.30–14025
metadataRecord<string, string>Your identifiers, echoed on the call, its webhooks and the
startframe of the agent stream. At most 20 keys (1–40 ofA-Za-z0-9_.-), values ≤ 500 characters. Never put personal data here: it is stored unencrypted.modestringRequiredWhat runs the conversation once the contact answers.
EXTERNAL_AGENT: the platform streams the call’s audio to youragent.streamUrland your server runs it.FLOW: a call flow — inline, stored, or a voice application’s answer URL (flow).AI_AGENT: one of the organization’s AI agents (aiAgent).BRIDGE: the contact is connected to an outside number or an agent’s softphone (bridge) — click-to-call with the contact dialled first. Either case is accepted; the documented spelling is canonical (what responses answer).One of
EXTERNAL_AGENTFLOWAI_AGENTBRIDGEexternal_agentflowai_agentbridgenotAfterstringT5 — never start dialling at or after this instant (ISO 8601 with its offset). A request that arrives at or after it is
422 CALL_NOT_AFTER_PASSEDand creates nothing; a call that could not be handed to the carrier before it (it is checked again right before the dial) endsfailedwithfailure.code: NOT_AFTER_PASSED, nothing rung. A retry of a request that already placed its call still answers that call.providerstringWhich carrier to dial over (
GET /v1/calls/channelslists the ones this organization can use). Omitted: the organization’s default channel for machine-placed calls. A channel this deployment does not run, or the organization has not set up, is409 CHANNEL_NOT_CONFIGURED.One of
airtelexotelplivotelnyxtwiliopurposestringWhat the call is for under TRAI/DLT rules, checked before the dial: a
PROMOTIONALcall needs an assigned 140-series number asfrom, a verified voice header and the 09:00–21:00 window in the called party’s zone; a 140-seriesfromis forPROMOTIONALcalls only. Omitted: undeclared (never read as promotional). Either case is accepted; the documented spelling is canonical (what responses answer).One of
SERVICETRANSACTIONALPROMOTIONALservicetransactionalpromotionalrecordingPublicCallRecordingRequestRequired2 fields of
recordingconsentEvidencePublicCallConsentEvidence3 fields of
consentEvidencecapturedAtstring (date-time)RequiredWhen the contact consented; never in the future.
sourcestringRequiredHow the contact consented. Either case is accepted; the documented spelling is canonical (what responses answer).
One of
WEB_FORMWRITTENVERBALOTHERweb_formwrittenverbalothertextstringRequiredThe consent text the contact saw or heard. Stored encrypted as the evidence.
at most 2000 characters
enabledbooleanRequiredRecord the call. An organization whose policy records every call records it regardless; either way a recorded call needs
consentEvidence.
referencestringYour own id for the call (a job, a visit, a campaign entry), echoed on the call as
reference, in an AI agent’s tool calls and session requests, and whatPOST /v1/calls/cancelends calls by. Not unique: every call you give one carries it. Never put personal data here: it is stored unencrypted.at most 200 characters
respectCallingWindowbooleanPlace the call only inside the calling window (09:00–21:00 in the organization’s time zone unless the deployment sets another); otherwise
409 CALLING_WINDOW_CLOSEDwithnextAllowedAt.default true
ringTimeoutSecintegerHow long the contact’s phone rings before the attempt is given up (carrier permitting).
5–120
sandboxPublicCallSandboxT8 — test keys only (a live key is
400 VALIDATION_FAILED): how the other side of this test call behaves once it is answered — the keys and speech for each gather of its flow, who answers each ring, what is said to a voicemail, when the contact hangs up, the mock AI agent’s conversation (lines, real signed tool calls, a key press, an opt-out, a hand-off) and the answering-machine verdict (machine). AFLOW,BRIDGEorAI_AGENTtest call plays it on the platform’s real call logic. See Integration testing.6 fields of
sandboxaiPublicSandboxAiScriptThe mock AI agent’s conversation when an agent takes the caller (an
airoute, a flow’saistep, anAI_AGENTcall). Absent, it plays a short scripted conversation and closes.1 field of
aiturnsPublicSandboxAiTurn[]RequiredThe conversation, in order (at most 50 turns). After the last, the agent closes the call.
8 fields of
turnsagentstringThe agent says this.
argumentsobjectThe tool call’s arguments (checked against its schema).
callerstringThe caller says this (one of the call’s opt-out phrases opts them out).
endbooleantrue: the agent ends the conversation (its closing line said).
hangUpbooleantrue: the caller hangs up.
pressstringThe caller presses a key (
call.dtmf); the call’s opt-out key opts them out.toolstringThe agent calls this tool — the call’s own tool of that name, else the agent’s — with
arguments: a real signed request to its URL.transferPublicSandboxTransferThe agent hands the caller to a person: the call’s
transfertarget (an AI call or route) — or, in a flow’saistep, itsonEscalate.3 fields of
transferansweredbooleanThe person answers (default true).
reasonstringWhy the agent asked (kept, never spoken).
talkSecondsintegerHow long they talk.
connectsPublicSandboxConnect[]Each party rung in turn (a sequence), each ring of several numbers at once, each seat offered the call and each queue’s wait, in order (at most 50). With none left, nobody answers.
7 fields of
connectsagentMembershipIdstring (uuid)A queue’s wait answered: the seat (membership id) that takes the caller; default the queue’s first member.
answeredByintegerNumbers rung at once (
strategy: simultaneous): which answered, by its place intargets(0-based; default 0).confirmbooleanPressed the confirm key when the step asks one (
confirm). Default true; false is a pickup that never confirmed — no answer.hangsUpstringWho ends the conversation: the caller (default — the call ends) or the party (the flow goes on).
One of
callerpartyoutcomestringDefault
no_answer.One of
answeredno_answerbusyfailedringSecondsintegerHow long it rang (default 5 when answered, else the step’s ring time). Answered later than the step rings for is no answer.
talkSecondsintegerHow long they talked once connected (default 30).
hangUpAfterSecondsintegerThe caller hangs up at this point of the call (seconds of call time), whatever runs then.
inputsPublicSandboxInput[]Answers to the flow’s gathers and menus (and a voicemail greeting’s keys), in order (at most 50). With none left, a gather times out.
4 fields of
inputsafterSecondsintegerWhen, in seconds after the prompt (default 1). Past the gather’s
timeoutSecondsthe gather times out first and this answers the next one, with what is left.digitsstringKeys pressed (
0-9,*,#), in order.hangUpbooleanThe caller hangs up here instead.
speechstringWhat the caller says — heard by a speech gather, and a line of the call’s transcript.
machinestringThe answering-machine verdict, for a call that asks for
machineDetection(oraiAgent.onMachine: hangup):call.machine_detected, the flow’samdvariable, and —machine— the call ended without a word where it says to.One of
humanmachineunknownrecordingsPublicSandboxRecording[]What the caller leaves each time the flow records them (a voicemail,
record), in order (at most 10). With none left, they hang up without a word.4 fields of
recordingskeystringA key pressed to end it: one of a voicemail’s
keys, or the finish key.secondsintegerHow long it runs (default: the speech at 2.5 words a second). Held to the step’s
maxSeconds.speechstringWhat they say: the voicemail’s transcript.
thenstringAfter it: hang up (default) or stay on the line.
One of
hang_upstay
statusCallbackPublicStatusCallbackAlso POST this call’s status events (
call.queued,.ringing,.answered,.completed,.failed,.no_answer,.busy, or the ones you name) to this URL — signed with your status-callback secret, retried like every webhook, kept 7 days. In addition to your webhook endpoints, never instead. 409 STATUS_CALLBACK_SECRET_MISSING until the secret exists (POST /v1/status-callback-secret).2 fields of
statusCallbackeventsstring[]Which of the resource’s status events to send; all of them when left out. A message: message.sent, message.delivered, message.read, message.failed. A call: call.queued, call.ringing, call.answered, call.completed, call.failed, call.no_answer, call.busy.
One of
message.sentmessage.deliveredmessage.readmessage.failedcall.queuedcall.ringingcall.answeredcall.completedcall.failedcall.no_answercall.busyurlstringRequiredWhere this message’s or call’s status events are POSTed, signed like every webhook (
Trovacast-Signature) with your status-callback secret (POST /v1/status-callback-secret). https on a public host and an allowed port (443, 80, or 1024 up that is not a well-known non-HTTP service’s), checked now and again at every delivery. Retried on the webhook schedule; kept 7 days. In addition to — never instead of — your webhook endpoints.at most 2048 characters
toPublicCallRecipient1 field of
tophonestringRequiredInternational format. The contact with this number is used, or created (needs
contacts:writeas well).
Response 201PublicCall
Its fields are listed under Get call.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.402BILLING_INSUFFICIENT_CREDIT (the balance cannot covermaxDurationSecbeside the API calls in flight;minutesRequired,balanceMinor,ratePerMinuteMinor), BILLING_SUBSCRIPTION_PAST_DUE, BILLING_SUBSCRIPTION_SUSPENDED or BILLING_SUBSCRIPTION_CANCELED.403ENTITLEMENT_CALLING_DISABLED — the organization does not have calling; or API_KEY_SCOPE_MISSING (to.phonealso needscontacts:write).404NOT_FOUND — no such contact; CALL_FLOW_NOT_FOUND, APPLICATION_NOT_FOUND, AI_AGENT_NOT_FOUND or BRIDGE_AGENT_NOT_FOUND — whatflow,aiAgentorbridgenames is not this organization’s.409CONTACT_DO_NOT_CALL, CONTACT_OPTED_OUT, CALLING_WINDOW_CLOSED (with nextAllowedAt), RECORDING_CONSENT_REQUIRED, AI_CALLS_DISABLED (the organization’s call policy; EXTERNAL_AGENT and AI_AGENT), CHANNEL_NOT_CONFIGURED (the channel is not on this deployment or not set up for the organization), CALL_FLOW_NOT_PUBLISHED, AI_AGENT_INACTIVE; or IDEMPOTENCY_KEY_IN_FLIGHT.422DESTINATION_BLOCKED (a +1 number), CONTACT_PHONE_REQUIRED, CHANNEL_UNSUPPORTED, AGENT_STREAM_URL_INVALID (with reason), CALLER_ID_UNSUPPORTED, CALLER_ID_NOT_OWNED, CALL_FLOW_INVALID (withissues), ANSWER_URL_INVALID (withreason), CHILD_DIAL_DESTINATION_NOT_ALLOWED (a bridged number outside the organization’s list), a dial-admission refusal (PROMOTIONAL rules: seepurpose); or IDEMPOTENCY_KEY_REUSED.429CALL_CONCURRENCY_LIMIT (scope:organizationorkey,limit,liveCalls; for the sandbox’s own cap on test callslivemode: falsewithtestCallsin place ofliveCalls— the modes never count against each other) — retry when a call ends; CARRIER_RATE_LIMITED (callId,retryAfterSeconds, also asRetry-After) — nothing was dialled; or RATE_LIMITED (the key’s request budget).500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).502CARRIER_REJECTED (callId) — the carrier refused the dial; nothing rang, the call isfailed, and a retry dials afresh.503BILLING_RATE_UNAVAILABLE (the plan does not price this channel), MEDIA_CAPACITY or MEDIA_DRAINING (the server that would carry the stream is full or restarting; nothing was dialled — retry shortly), or SERVICE_UNAVAILABLE (the channel is temporarily unavailable on this deployment).
curl -X POST 'https://api.trovacast.com/v1/calls' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H 'Idempotency-Key: call-order-1042' \
-H 'Content-Type: application/json' \
-d '{
"mode": "EXTERNAL_AGENT",
"to": {
"phone": "+919876543210"
},
"agent": {
"streamUrl": "wss://agent.example.com/trovacast/stream",
"token": "AGENT_STREAM_TOKEN",
"audio": {
"encoding": "pcm_s16le",
"sampleRate": 16000
}
},
"recording": {
"enabled": true,
"consentEvidence": {
"source": "WEB_FORM",
"text": "I agree to a recorded call about my order.",
"capturedAt": "2026-11-05T09:30:00.000Z"
}
},
"maxDurationSec": 300,
"metadata": {
"orderId": "1042"
}
}'{
"agent": {
"audio": {
"encoding": "pcm_s16le",
"sampleRate": 16000
},
"maxDurationSec": 1,
"streamUrl": "STREAM_URL"
},
"aiAgentId": "AI_AGENT_ID",
"answeredAt": "2026-11-05T10:00:00.000Z",
"bridge": {
"agentMembershipId": "AGENT_MEMBERSHIP_ID",
"numberLast4": "0000",
"phoneId": "PHONE_ID",
"ringFirst": "contact",
"target": "number"
},
"charge": {
"amountMinor": 180,
"chargedMinutes": 3,
"currency": "INR",
"includedMinutes": 0,
"ratePerMinuteMinor": 60,
"ratedAt": "2026-11-05T10:00:00.000Z",
"reason": null,
"rule": null,
"status": "charged"
},
"contactId": "CONTACT_ID",
"createdAt": "2026-11-05T10:00:00.000Z",
"direction": "inbound",
"durationSeconds": 1,
"endedAt": "2026-11-05T10:00:00.000Z",
"failure": {
"code": "NO_ANSWER",
"reason": "REASON"
},
"flow": {
"applicationId": "APPLICATION_ID",
"callFlowId": "CALL_FLOW_ID",
"source": "definition"
},
"from": "+918031152580",
"fromSource": "organization_number",
"hangup": {
"apiKeyId": "API_KEY_ID",
"reason": "api-hangup",
"side": "agent"
},
"id": "ID",
"initiatedAt": "2026-11-05T10:00:00.000Z",
"legRole": "primary",
"livemode": true,
"machineDetection": {
"detectedAt": "2026-11-05T10:00:00.000Z",
"mode": "detect",
"result": "human"
},
"metadata": {},
"mode": "external_agent",
"numberId": "NUMBER_ID",
"object": "call",
"parentCallId": "PARENT_CALL_ID",
"provider": "airtel",
"purpose": "service",
"recording": {
"durationSeconds": 1,
"expiresAt": "EXPIRES_AT",
"format": "audio/mpeg",
"id": "ID",
"noticePlayed": true,
"purpose": "call",
"status": "pending",
"url": "URL"
},
"recordingEnabled": true,
"reference": "REFERENCE",
"ringingAt": "2026-11-05T10:00:00.000Z",
"rootCallId": "ROOT_CALL_ID",
"status": "queued",
"to": "•••• ••3210",
"updatedAt": "2026-11-05T10:00:00.000Z"
}Cancel calls
post
Cancels the calls placed with a reference.
Ends every queued or live call of the key’s mode placed with reference (POST /v1/calls reference) — the newest 50 — and answers each with what came of it: cancelled (this request ended it: one not yet answered ends cancelled, an answered one is ending), ended (it was already over), pending (the carrier cannot be asked to end it yet — a call not yet handed to the carrier never will be, as the dial checks again first — send the same request again shortly), unsupported (its channel can never end a call remotely). Idempotent: a repeat answers the same calls, over. No call with the reference answers calls: []. A test key ends only test calls (their sandbox), a live key only live ones.
Access: an organization key with the calls:write scope.
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. This endpoint converges when run again, so a 5xx stores nothing either: a retry with the same key runs it again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
referencestringRequiredThe
referencethe calls were placed with.1–200 characters
Response 200PublicCallCancellation
callsPublicCallCancellationItem[]RequiredEvery call of the key’s mode placed with the reference, newest first (at most 50).
2 fields of
callscallPublicCallRequiredIts fields are listed under Get call
outcomestringRequiredcancelled: this request ended it (not yet answered:cancelled; answered: it is ending);ended: it was already over;pending: it cannot be ended just yet — the carrier has not given it the id it is ended by (if it had not been dialled, it never will be) — send the same request again shortly;unsupported: its channel can never end a call remotely.One of
cancelledendedpendingunsupported
objectstringRequiredOne of
call_cancellationreferencestringRequired
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.409IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running (retry afterRetry-After); or CONFLICT.422IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl -X POST 'https://api.trovacast.com/v1/calls/cancel' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"reference": "visit_8812_reminder"
}'{
"calls": [
{
"call": {
"agent": {
"audio": {
"encoding": "pcm_s16le",
"sampleRate": 16000
},
"maxDurationSec": 1,
"streamUrl": "STREAM_URL"
},
"aiAgentId": "AI_AGENT_ID",
"answeredAt": "2026-11-05T10:00:00.000Z",
"bridge": {
"agentMembershipId": "AGENT_MEMBERSHIP_ID",
"numberLast4": "0000",
"phoneId": "PHONE_ID",
"ringFirst": "contact",
"target": "number"
},
"charge": {
"amountMinor": 180,
"chargedMinutes": 3,
"currency": "INR",
"includedMinutes": 0,
"ratePerMinuteMinor": 60,
"ratedAt": "2026-11-05T10:00:00.000Z",
"reason": null,
"rule": null,
"status": "charged"
},
"contactId": "CONTACT_ID",
"createdAt": "2026-11-05T10:00:00.000Z",
"direction": "inbound",
"durationSeconds": 1,
"endedAt": "2026-11-05T10:00:00.000Z",
"failure": {
"code": "NO_ANSWER",
"reason": "REASON"
},
"flow": {
"applicationId": "APPLICATION_ID",
"callFlowId": "CALL_FLOW_ID",
"source": "definition"
},
"from": "+918031152580",
"fromSource": "organization_number",
"hangup": {
"apiKeyId": "API_KEY_ID",
"reason": "api-hangup",
"side": "agent"
},
"id": "ID",
"initiatedAt": "2026-11-05T10:00:00.000Z",
"legRole": "primary",
"livemode": true,
"machineDetection": {
"detectedAt": "2026-11-05T10:00:00.000Z",
"mode": "detect",
"result": "human"
},
"metadata": {},
"mode": "external_agent",
"numberId": "NUMBER_ID",
"object": "call",
"parentCallId": "PARENT_CALL_ID",
"provider": "airtel",
"purpose": "service",
"recording": {
"durationSeconds": 1,
"expiresAt": "EXPIRES_AT",
"format": "audio/mpeg",
"id": "ID",
"noticePlayed": true,
"purpose": "call",
"status": "pending",
"url": "URL"
},
"recordingEnabled": true,
"reference": "REFERENCE",
"ringingAt": "2026-11-05T10:00:00.000Z",
"rootCallId": "ROOT_CALL_ID",
"status": "queued",
"to": "•••• ••3210",
"updatedAt": "2026-11-05T10:00:00.000Z"
},
"outcome": "cancelled"
}
],
"object": "call_cancellation",
"reference": "REFERENCE"
}List call channels
get
Lists the channels a call can be placed over, and which one is the default.
Every calling channel this deployment runs, as POST /v1/calls names it in provider: whether a call can be placed on it now for this organization (ready), whether it is where a call naming no provider goes (default), and what it carries — an external agent’s stream, call flows and bridges (flows), agent-first bridges, a chosen caller ID, remote hang-up and answering-machine detection. Checked live, with the same readiness rules a dial applies, so pick a channel here rather than learning it from a refusal.
Access: an organization key with the calls:read scope.
Response 200PublicCallChannelList
dataPublicCallChannel[]Required12 fields of
dataagentFirstbooleanRequiredThe channel can ring an agent’s phone first and then bridge the contact in (
mode: BRIDGEwithbridge.ringFirst: agent). False: that is422 CHANNEL_UNSUPPORTEDon it.callerIdSelectionbooleanRequiredPOST /v1/callsmay namefrom: the channel publishes the organization’s numbers, so a chosen caller ID can be checked. False:fromis422 CALLER_ID_UNSUPPORTED.defaultbooleanRequiredWhere a call that names no
providerdials for this organization.externalAgentbooleanRequiredThe channel can carry
mode: EXTERNAL_AGENT(it streams the call’s audio).flowsbooleanRequiredThe channel can carry
mode: FLOWandmode: BRIDGE(it streams the call into the platform’s media room). False: those modes are422 CHANNEL_UNSUPPORTEDon it.labelstringRequiredA display name.
machineDetectionbooleanRequiredThe channel can tell an answering machine from a person:
POST /v1/callsmay sendmachineDetectionon it (elsewhere422 MACHINE_DETECTION_UNSUPPORTED), and the verdict arrives ascall.machine_detected.objectstringRequiredOne of
call_channelproviderstringRequiredThe value
POST /v1/callstakes asprovider.One of
airtelexotelplivotelnyxtwilioreadybooleanRequiredA call can be placed on it now: set up for this organization, and every setting the deployment needs is in place. False is what
409 CHANNEL_NOT_CONFIGURED(or422 CHANNEL_UNSUPPORTED) would answer.remoteHangupbooleanRequiredThe carrier ends a call on request, ringing or answered. False:
POST /v1/calls/:id/hangupends the call by closing its stream, so a call not yet answered is409 HANGUP_NOT_READYuntil it is.sensitiveGatherbooleanRequiredA
sensitivegather (a call action, or a flow’sgatherverb) can run on the channel’s recorded calls: its carrier keeps no recording of its own, or pauses it for the gather and resumes it after. False: the carrier records the call and cannot pause that, so on a recorded call a sensitive gather is refused (409 RECORDING_NOT_CONTROLLABLE; a flow fails with that cause). A call that is not recorded takes one on every channel.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/calls/channels' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"data": [
{
"agentFirst": true,
"callerIdSelection": true,
"default": true,
"externalAgent": true,
"flows": true,
"label": "Airtel IQ",
"machineDetection": true,
"object": "call_channel",
"provider": "airtel",
"ready": true,
"remoteHangup": true,
"sensitiveGather": true
}
]
}Get call
get
Retrieves a call.
The same object the call.* events carry: status, direction, mode and channel, the timeline (initiatedAt to endedAt), durationSeconds, failure and hangup once it ends, the recording’s state (never a link — GET /v1/calls/{callId}/recording mints one), your metadata, and its place in a call graph (parentCallId, rootCallId). A key reads the calls of its own mode only: a live call’s id read with a test key answers 404.
Access: an organization key with the calls:read scope.
Path parameters
callIdstringRequired
Response 200PublicCall
Show the 35 fieldsHide the fields
agentPublicCallAgent | nullRequired3 fields of
agentaudioPublicCallAgentAudioRequired2 fields of
audioencodingstringRequiredOne of
pcm_s16lesampleRateintegerRequiredOne of
16000
maxDurationSecintegerRequiredstreamUrlstringRequired
aiAgentIdstring (uuid) | nullRequiredThe AI agent (
GET /v1/agents) that ran an AI call; null for other calls.answeredAtstring (date-time) | nullRequiredbridgePublicCallBridgeInfo | nullRequired5 fields of
bridgeagentMembershipIdstring (uuid) | nullRequirednumberLast4string | nullRequiredThe bridged number’s last four digits (a number’s, or a phone’s rung after the contact); never the number.
phoneIdstring (uuid) | nullRequiredP7 — the organization’s own phone (
/v1/phones) the call bridged, by id; null for any other target.ringFirststringRequiredWho was rung first — the contact (then connected to the target), or the agent’s own phone (click-to-call; the contact was dialled once they answered).
One of
contactagenttargetstringRequirednumber(an outside number),agent(a seat) or — P7 —phone(one of the organization’s own phones,phoneId).One of
numberagentphone
chargePublicCallCharge | nullWhat the call cost, once rated after it ended (per started minute after the plan’s included minutes). Null before, and always for a test-mode call.
9 fields of
chargeamountMinorintegerRequiredchargedMinutesintegerRequiredStarted minutes billed after the included minutes.
currencystringRequiredincludedMinutesintegerRequiredIncluded minutes this call used.
ratePerMinuteMinorintegerRequiredratedAtstring (date-time)Requiredreasonstring | nullRequiredThe rating’s own sentence about this charge — the rule it applied, or why it is
unrated(the plan has no rate for the call’s direction, type and channel) orwaived; null when there is nothing to say. Plain English for people; switch onruleandstatus, never on this text.rulestring | nullRequiredThe rule the call was rated by when it was not its talk time at its plan’s rate for its type; null when it was (or it never connected).
STALL_SILENT: a stuck call a supervisor cleared, silent inside its ceiling — rated from answer to its last sign of life plus 60 s, capped at its ceiling.STALL_PAST_CEILING: one cleared past its ceiling — rated to its ceiling.AI_VOICE_NEVER_STARTED: an AI call whose AI voice never started — rated at the channel’s manual rate for its connected time.TALK_TIME_UNKNOWN: a connected call whose talk time is unknown —waived. When a stall and an AI voice that never started both apply, the stall is named andreasonsays both. v1 may add values: read one you do not know as an unexplained rule, byreason.One of
STALL_SILENTSTALL_PAST_CEILINGAI_VOICE_NEVER_STARTEDTALK_TIME_UNKNOWNstatusstringRequiredcharged;not_connected— never answered, nothing billed;waived;unrated— your plan has no price for it yet: re-rated if it gains one within 7 days of the call’s end (2026-11-07), and otherwise left unrated unless the platform runs a backfill for your organization.One of
chargednot_connectedwaivedunrated
contactIdstring (uuid) | nullRequiredcreatedAtstring (date-time)RequireddirectionstringRequiredOne of
inboundoutbounddurationSecondsinteger | nullRequiredendedAtstring (date-time) | nullRequiredfailurePublicCallFailure | nullRequired2 fields of
failurecodestringRequiredStable machine value:
NO_ANSWER,BUSY,CANCELLED, or a failure code.reasonstringRequiredA plain-language reason.
flowPublicCallFlowInfo | nullRequiredWhere a flow-driven call’s instructions come from: a
/v1FLOW call’s, or (2026-11-06) an inbound call routed to a call flow or a voice application (source: call_flow/applicationwith its id). Null for every other call.3 fields of
flowapplicationIdstring (uuid) | nullRequiredcallFlowIdstring (uuid) | nullRequiredsourcestringRequireddefinition: an inline document (not echoed);call_flow: a stored flow’s published version;application: a voice application’s answer URL.One of
definitioncall_flowapplication
fromstring | nullRequiredThe calling number. Outbound: the organization’s own number the call presents to the contact, in international format (E.164) — the request’s
fromwhen it chose one, else the assigned agent’s allocated number, else the channel account’s caller ID; null only when nothing names one (a handset-dialled channel). Inbound: the caller — a person — masked to their last four digits (•••• ••3210), exactly as an outbound call’stois; null when they withheld their number.fromSourcestring | nullRequiredWhere an outbound call’s
fromcame from:request(the request’sfrom),organization_number(a call that named nofrom, given one of your own numbers on the channel —numberIdnames it),agent_number(the assigned agent’s allocated number),carrier_account(the caller ID of your own carrier account on the channel) orplatform(the platform’s shared number: you hold no number of your own on the channel, so a contact who calls it back does not reach you). Null on an inbound call, whenfromis null, and on a call placed before 2026-11-06 22:35 UTC.One of
requestorganization_numberagent_numbercarrier_accountplatformhangupPublicCallHangup | nullRequired3 fields of
hangupapiKeyIdstring (uuid) | nullRequiredThe API key whose
POST …/hangupended the call (reason: api-hangup); null for any other ending.reasonstring | nullRequiredWhat ended it, when the platform knows:
api-hangup(POST …/hangup),agent-hangup(an agent hung up in the console),supervisor-end(a supervisor’s End call, 2026-11-07),hangup(yourhangupframe),max_duration,agent_lost; for a flow (2026-11-06)hangup_verb,instructions_ended,ai_ended,callback_requested,flow_failedandcaller_hung_up.sidestringRequiredagent: your side (ahangupframe on the stream, orPOST …/hangup; also a person in the console — an agent hanging up, or a supervisor’s End call);application: the call’s own instructions (a flow’s or answer URL’shangupverb, the instructions running out, anaiverb’s agent finishing — 2026-11-06);contact: the caller left while a flow ran (and a test call’s simulated contact);platform: the ceiling, a lost agent stream or a failed flow;unknown: nothing recorded who — the carrier ended it without saying (the contact, most often, but never assumed).One of
agentcontactplatformapplicationunknown
idstring (uuid)RequiredinitiatedAtstring (date-time) | nullRequiredlegRolestringRequiredprimaryfor a call itself; otherwise what the leg is in its root’s graph.GET /v1/callslists root calls unlessinclude=legs.One of
primarytransfer_targetconferenceconsultagent_phonecarrier_bleglivemodebooleanRequiredFalse when a test-mode (
tc_test_…) key created it: it went to a sandbox, never to a real provider, and was never billed.machineDetectionPublicCallMachineDetection | nullRequiredAnswering-machine detection, when the call asked for it (
machineDetection); null otherwise.3 fields of
machineDetectiondetectedAtstring (date-time) | nullRequiredmodestringRequiredWhat
POST /v1/callsasked for (machineDetection).One of
detectdetect_and_hangupresultstring | nullRequiredThe carrier’s verdict once it arrives (
call.machine_detected); null before.unknown: the carrier could not tell.One of
humanmachineunknown
metadataRecord<string, string>RequiredThe
metadatayou sent, echoed verbatim.modestringRequiredOne of
external_agentaimanualhybridflowbridgenumberIdstring (uuid) | nullRequiredThe organization’s inventory number on the business side of the call (
GET /v1/numbers/{numberId}): the one an inbound call came in on (PATCHit to change where its calls go), or the one an outbound call presents asfrom. Null when that number is not in the organization’s inventory (a carrier account’s own caller ID, a platform number).objectstringRequiredOne of
callparentCallIdstring (uuid) | nullRequiredThe call this leg was dialled from (a transfer target, a conference party, a bridged number); null for a root call.
providerstringRequiredOne of
airtelexotelplivosimtelnyxtwiliopurposestring | nullRequiredWhat the call is for under TRAI/DLT rules, as declared (
purposeonPOST /v1/calls, or the campaign’s); null when undeclared.One of
servicetransactionalpromotionalrecordingPublicCallRecording | nullRequired8 fields of
recordingdurationSecondsinteger | nullRequiredexpiresAtstring | nullRequiredAlways null; see
url.formatstring | nullRequiredidstring (uuid)RequirednoticePlayedbooleanRequiredA recording notice (a call flow’s
notice) played before the platform started this recording. False when none did, and for a carrier’s own copy of the call, which starts with the call.purposestringRequiredWhat it is of:
call— the call itself (the carrier’s or the stream’s copy, a call flow’srecord, aconnectthat recorded its conversation) — orvoicemail, a message the caller left.One of
callvoicemailstatusstringRequiredOne of
pendingprocessingavailablefaileddeletedurlstring | nullRequiredAlways null: a download link is minted only by
GET /v1/calls/:id/recording(scoperecordings:read), never on a call read or a webhook.
recordingEnabledbooleanRequiredreferencestring | nullRequiredYour
referencefor the call (POST /v1/calls), echoed verbatim; null when it has none.ringingAtstring (date-time) | nullRequiredrootCallIdstring (uuid) | nullRequiredThe root of this call’s graph; null for a root call.
statusstringRequiredqueued(created, not yet accepted by the carrier) →initiating(the carrier accepted the dial) →ringing→in_progress→ (ending) →completed; orbusy,no_answer,cancelled,failed.One of
queuedinitiatingringingin_progressendingcompletedbusyno_answercancelledfailedtostring | nullRequiredThe number dialled. Inbound: the organization’s own number the caller dialled, in international format (
+918031152018). Outbound: the contact — a person — masked to their last four digits (•••• ••3210); a person’s number is never on a call in full (read the contact bycontactId).updatedAtstring (date-time)Required
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such call.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/calls/CALL_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"agent": {
"audio": {
"encoding": "pcm_s16le",
"sampleRate": 16000
},
"maxDurationSec": 1,
"streamUrl": "STREAM_URL"
},
"aiAgentId": "AI_AGENT_ID",
"answeredAt": "2026-11-05T10:00:00.000Z",
"bridge": {
"agentMembershipId": "AGENT_MEMBERSHIP_ID",
"numberLast4": "0000",
"phoneId": "PHONE_ID",
"ringFirst": "contact",
"target": "number"
},
"charge": {
"amountMinor": 180,
"chargedMinutes": 3,
"currency": "INR",
"includedMinutes": 0,
"ratePerMinuteMinor": 60,
"ratedAt": "2026-11-05T10:00:00.000Z",
"reason": null,
"rule": null,
"status": "charged"
},
"contactId": "CONTACT_ID",
"createdAt": "2026-11-05T10:00:00.000Z",
"direction": "inbound",
"durationSeconds": 1,
"endedAt": "2026-11-05T10:00:00.000Z",
"failure": {
"code": "NO_ANSWER",
"reason": "REASON"
},
"flow": {
"applicationId": "APPLICATION_ID",
"callFlowId": "CALL_FLOW_ID",
"source": "definition"
},
"from": "+918031152580",
"fromSource": "organization_number",
"hangup": {
"apiKeyId": "API_KEY_ID",
"reason": "api-hangup",
"side": "agent"
},
"id": "ID",
"initiatedAt": "2026-11-05T10:00:00.000Z",
"legRole": "primary",
"livemode": true,
"machineDetection": {
"detectedAt": "2026-11-05T10:00:00.000Z",
"mode": "detect",
"result": "human"
},
"metadata": {},
"mode": "external_agent",
"numberId": "NUMBER_ID",
"object": "call",
"parentCallId": "PARENT_CALL_ID",
"provider": "airtel",
"purpose": "service",
"recording": {
"durationSeconds": 1,
"expiresAt": "EXPIRES_AT",
"format": "audio/mpeg",
"id": "ID",
"noticePlayed": true,
"purpose": "call",
"status": "pending",
"url": "URL"
},
"recordingEnabled": true,
"reference": "REFERENCE",
"ringingAt": "2026-11-05T10:00:00.000Z",
"rootCallId": "ROOT_CALL_ID",
"status": "queued",
"to": "•••• ••3210",
"updatedAt": "2026-11-05T10:00:00.000Z"
}Create call action
post
Acts on a live call: speak, play, gather, send DTMF, hold, resume, mute, transfer, record, hang up.
One action on a live, answered call whose audio streams through the platform, answered with the call. speak, play, gather and transfer answer started and finish on the call — a gather’s result arrives as call.gather.completed, a transfer as call.transferred — and the rest answer completed (hold and resume also fire call.held and call.resumed); every action is audited against the key, and a retry with the same Idempotency-Key is answered with the first response without acting twice. Refused with 409 CALL_NOT_ANSWERED before the contact answers, 409 CALL_NOT_CONTROLLABLE on a call whose audio does not stream through the platform, 409 CALL_ACTION_IN_PROGRESS while a prompt, gather or call flow is speaking, and 422 CALL_ACTION_UNSUPPORTED on a leg (act on its rootCallId; only hangup ends a leg). A key acts on calls of its own mode only — a test key’s test calls are answered by the sandbox as a live call would be — and a call of the other mode answers 404, exactly as an unknown id; the one exception is hangup, with which any key ends a test call.
Access: an organization key with the calls:write scope.
Path parameters
callIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
actionstringRequiredspeak(text),play(url),gather(input:dtmf|speech|dtmf_speech; keys:numDigits,finishOnKey,timeoutSec,prompt,sensitive; speech:language,hints,speechTimeoutSec),send_dtmf(digits),hold(audioUrl),resume,mute/unmute(your own leg: an external agent’s audio),transfer(to,ringTimeoutSec),record(state:pause|resume),hangup.One of
speakplaygathersend_dtmfholdresumemuteunmutetransferrecordhangupaudioUrlstringhold: an https WAV URL played on a loop while held; a soft tone when unset.at most 2048 characters
digitsstringsend_dtmf: keys to press on the call:0-9 * #,wfor a half-second pause; at most 32.finishOnKeystringgather: the key that ends input early ("": none).One of
#*default "#"
hintsstring[]gatherwith speech: words and phrases the caller is likely to say (at most 50, 100 characters each). Accepted for every recognizer; applied only where the recognizer takes hints (see the docs).at most 50 items
inputstringgather: what to listen for — keys (dtmf), the caller’s words (speech), or either (dtmf_speech: the first key wins and the words are dropped). Speech is transcribed by the platform’s speech recognition and lands incall.gather.completedasspeech: { text, confidence };422 CALL_ACTION_UNSUPPORTED(reason: speech_recognition_unavailable) on a deployment without it.One of
dtmfspeechdtmf_speechdefault "dtmf"
interDigitTimeoutSecintegergather: seconds allowed between keys.interDigitTimeoutSecondsis accepted as an alias; not both.1–30
languagestringspeak: BCP 47 language.gatherwith speech: the language the caller speaks (recognized in its primary language,en).numDigitsintegergather: stop after this many keys.1–32
promptPublicCallGatherPromptgather: played first; any key press interrupts it.2 fields of
prompttextstringSpoken (speech synthesis).
at most 1000 characters
urlstringAn https URL of a WAV file, fetched through the SSRF guard.
at most 2048 characters
ringTimeoutSecintegertransferto a number: how long it rings before the caller is taken off hold again.5–120default 30
sensitivebooleangather: card numbers, PINs — the digits are never stored, logged or sent (call.gather.completedcarriesdigits: null), and it runs only while every recording of the call is paused for its whole length: Trovacast’s own recording, and the carrier’s when the carrier records the call itself. On a recorded call, a channel withsensitiveGather: trueinGET /v1/calls/channelspauses the carrier’s recording before the action answers (503 RECORDING_PAUSE_FAILEDwhen the carrier did not confirm it, and nothing is collected) and resumes it after; on any other channel it is refused (409 RECORDING_NOT_CONTROLLABLE). A call that is not recorded takes it on every channel. DTMF only: a sensitive gather never takesinput: speechordtmf_speech.default false
speechTimeoutSecintegergatherwith speech: seconds of quiet after the caller speaks that end their answer (an answer is at most 60 seconds).speechTimeoutSecondsis accepted as an alias; not both.1–10default 2
statestringrecord: pause the platform’s recording of the call while something sensitive is said, or resume it. One state shared with the agent’s desk:resumereleases this key’s pause only (an agent’s pause keeps it paused), and the agent’s Resume releases this key’s pause too.One of
pauseresumetextstringspeak: what to say to the call (speech synthesis).at most 1000 characters
timeoutSecintegergather: seconds to wait for the first key.timeoutSeconds(the call-flowgatherverb’s name for it) is accepted as an alias; send one or the other — both together is400.1–60default 5
toPublicCallTransferTargettransfer: where to.4 fields of
toapplicationIdstring (uuid)A voice application: its answer URL takes the call over.
callFlowIdstring (uuid)A stored call flow: its published version takes the call over (an IVR, a queue, an agent — whatever it does).
numberstringAn outside number (international format): dialled as a leg of the call; the caller is held until it answers, then connected. On the organization’s list of destinations for connected parties only.
queueIdstring (uuid)One of your organization’s call queues: the caller waits there like any queued caller (its hold audio, announcements and overflow; voicemail if nobody takes them) until an agent accepts — ahead of new callers when the queue boosts transfers. The accepting agent sees that the call was transferred. Whatever ran the call (a flow, an agent) leaves it at once.
urlstringplay: an https URL of a WAV file (at most about five minutes), fetched through the SSRF guard.at most 2048 characters
voicestringspeak: a voice id from the speech catalog; the deployment default when unset.at most 64 characters
Response 200PublicCallActionResult
actionstringRequiredOne of
speakplaygathersend_dtmfholdresumemuteunmutetransferrecordhangupcallPublicCallRequiredIts fields are listed under Get call
callIdstring (uuid)Requiredidstring (uuid)RequiredThis action’s id; the events it leads to (
call.gather.completed,call.transferred,call.held,call.resumed) carry it asactionId.objectstringRequiredOne of
call_actionstatusstringRequiredcompleted: done when this answered (send_dtmf,hold,resume,mute,unmute,record,hangup).started: under way on the call (speak,play,gather,transfer) —gatherandtransferend in their own event.One of
completedstarted
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.402BILLING_* — atransferto a number is a billed leg the wallet cannot pay for.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such call; CALL_FLOW_NOT_FOUND or APPLICATION_NOT_FOUND — atransfertarget that is not this organization’s.409CALL_NOT_LIVE, CALL_NOT_ANSWERED (act once the call is in_progress), CALL_NOT_CONTROLLABLE (a phone-leg or SIM call: its audio does not stream through the platform), CALL_ON_ANOTHER_REPLICA (the server carrying the call could not be reached in time; retry), CALL_ACTION_IN_PROGRESS (a prompt or gather — or a call flow — is speaking on the call;runningActionIdorreason), CALL_NOT_HELD, RECORDING_NOT_CONTROLLABLE (recordon a call its carrier records, or asensitivegather on a recorded call whose carrier cannot pause its own recording —sensitiveGather: falseinGET /v1/calls/channels), CALL_FLOW_NOT_PUBLISHED, CHILD_LEG_LIMIT, AGENT_BUSY, HANGUP_NOT_READY, HANGUP_UNSUPPORTED; or IDEMPOTENCY_KEY_IN_FLIGHT.422CALL_ACTION_UNSUPPORTED (withreason: e.g.no_own_legfor mute on a call with no leg of yours), AUDIO_UNAVAILABLE (withreason), DTMF_INVALID, DESTINATION_BLOCKED, CHILD_DIAL_DESTINATION_NOT_ALLOWED, AI_PROVIDER_UNAVAILABLE (atransferto a call flow that hands callers to an AI agent whose voice cannot run on this deployment —reason,provider,legandagentId, the vocabulary of the agent’savailability; nothing was changed on the call), or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).503TTS_UNAVAILABLE (speakon a deployment without speech synthesis — nothing was played), RECORDING_PAUSE_FAILED (asensitivegather whose pause of the carrier’s recording the carrier did not confirm — nothing was collected), CHILD_LEG_UNSUPPORTED, MEDIA_CAPACITY, MEDIA_DRAINING, HANGUP_FAILED, AGENT_OFFER_UNAVAILABLE.
curl -X POST 'https://api.trovacast.com/v1/calls/CALL_ID/actions' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H 'Idempotency-Key: gather-order-number' \
-H 'Content-Type: application/json' \
-d '{
"action": "gather",
"prompt": {
"text": "Please enter your six-digit order number."
},
"numDigits": 6,
"finishOnKey": "#"
}'{
"action": "speak",
"call": {
"agent": {
"audio": {
"encoding": "pcm_s16le",
"sampleRate": 16000
},
"maxDurationSec": 1,
"streamUrl": "STREAM_URL"
},
"aiAgentId": "AI_AGENT_ID",
"answeredAt": "2026-11-05T10:00:00.000Z",
"bridge": {
"agentMembershipId": "AGENT_MEMBERSHIP_ID",
"numberLast4": "0000",
"phoneId": "PHONE_ID",
"ringFirst": "contact",
"target": "number"
},
"charge": {
"amountMinor": 180,
"chargedMinutes": 3,
"currency": "INR",
"includedMinutes": 0,
"ratePerMinuteMinor": 60,
"ratedAt": "2026-11-05T10:00:00.000Z",
"reason": null,
"rule": null,
"status": "charged"
},
"contactId": "CONTACT_ID",
"createdAt": "2026-11-05T10:00:00.000Z",
"direction": "inbound",
"durationSeconds": 1,
"endedAt": "2026-11-05T10:00:00.000Z",
"failure": {
"code": "NO_ANSWER",
"reason": "REASON"
},
"flow": {
"applicationId": "APPLICATION_ID",
"callFlowId": "CALL_FLOW_ID",
"source": "definition"
},
"from": "+918031152580",
"fromSource": "organization_number",
"hangup": {
"apiKeyId": "API_KEY_ID",
"reason": "api-hangup",
"side": "agent"
},
"id": "ID",
"initiatedAt": "2026-11-05T10:00:00.000Z",
"legRole": "primary",
"livemode": true,
"machineDetection": {
"detectedAt": "2026-11-05T10:00:00.000Z",
"mode": "detect",
"result": "human"
},
"metadata": {},
"mode": "external_agent",
"numberId": "NUMBER_ID",
"object": "call",
"parentCallId": "PARENT_CALL_ID",
"provider": "airtel",
"purpose": "service",
"recording": {
"durationSeconds": 1,
"expiresAt": "EXPIRES_AT",
"format": "audio/mpeg",
"id": "ID",
"noticePlayed": true,
"purpose": "call",
"status": "pending",
"url": "URL"
},
"recordingEnabled": true,
"reference": "REFERENCE",
"ringingAt": "2026-11-05T10:00:00.000Z",
"rootCallId": "ROOT_CALL_ID",
"status": "queued",
"to": "•••• ••3210",
"updatedAt": "2026-11-05T10:00:00.000Z"
},
"callId": "CALL_ID",
"id": "ID",
"object": "call_action",
"status": "completed"
}List call events
get
Lists what happened on a call, oldest first.
The call’s timeline, paged with limit and cursor like every list (oldest first here): created, queued, ringing, answered and ended (with the call’s status and failure); each step of its flow (flow_step.started, then flow_step.ended with its outcome, whether it took its fallback and the code why) and each AI step admitted or refused (ai_step.admitted, ai_step.refused with its code); queue waits, transfers and the legs that joined and left; the recording paused and resumed; where the speech-to-text was lost (transcription.unavailable) and came back; the ceiling reached; and, once the call is rated, its charge (rated, always last). Each entry carries ids the API already shows, closed words and machine codes, a transfer target masked to its last four digits — never transcript text, digits pressed or a secret. While the call is live the last page ends with what has happened so far: read it again for what follows. A key reads the calls of its own mode only: a call of the other mode answers 404, exactly as an unknown id. A test call’s timeline is the call sandbox’s walk, entry for entry what a live call of its mode records: created, queued, ringing, answered and ended (a busy, unanswered or failed one without the steps it never reached); the sandbox runs no flow and connects no AI, so there are no flow or AI steps, and a test call is never rated, so there is no rated. Entries are kept from 2026-11-07 for flow outcomes, AI admissions, recording pauses and the ceiling; earlier calls show what was kept then.
Access: an organization key with the calls:read scope.
Path parameters
callIdstringRequired
Query parameters
limitintegerHow many items to return.
cursorstringThe
nextCursorof the previous page. Omit for the first page.
Response 200PublicCallTimelinePage
dataPublicCallTimelineEvent[]Required7 fields of
datacallIdstring (uuid)RequireddataPublicCallTimelineDataRequired24 fields of
dataagentIdstring (uuid)ai_step.*: the AI agent (GET /v1/agents/{agentId}).applicationIdstring (uuid)application.fallback: the voice application whose answer URL (and fallback URL) gave no usable instructions.bystringrecording.*: whose hand —api(a key’srecordaction) ordesk(the agent on the call).One of
apideskchargePublicCallChargerated: the call’s charge, aschargeon the call.9 fields of
chargeamountMinorintegerRequiredchargedMinutesintegerRequiredStarted minutes billed after the included minutes.
currencystringRequiredincludedMinutesintegerRequiredIncluded minutes this call used.
ratePerMinuteMinorintegerRequiredratedAtstring (date-time)Requiredreasonstring | nullRequiredThe rating’s own sentence about this charge — the rule it applied, or why it is
unrated(the plan has no rate for the call’s direction, type and channel) orwaived; null when there is nothing to say. Plain English for people; switch onruleandstatus, never on this text.rulestring | nullRequiredThe rule the call was rated by when it was not its talk time at its plan’s rate for its type; null when it was (or it never connected).
STALL_SILENT: a stuck call a supervisor cleared, silent inside its ceiling — rated from answer to its last sign of life plus 60 s, capped at its ceiling.STALL_PAST_CEILING: one cleared past its ceiling — rated to its ceiling.AI_VOICE_NEVER_STARTED: an AI call whose AI voice never started — rated at the channel’s manual rate for its connected time.TALK_TIME_UNKNOWN: a connected call whose talk time is unknown —waived. When a stall and an AI voice that never started both apply, the stall is named andreasonsays both. v1 may add values: read one you do not know as an unexplained rule, byreason.One of
STALL_SILENTSTALL_PAST_CEILINGAI_VOICE_NEVER_STARTEDTALK_TIME_UNKNOWNstatusstringRequiredcharged;not_connected— never answered, nothing billed;waived;unrated— your plan has no price for it yet: re-rated if it gains one within 7 days of the call’s end (2026-11-07), and otherwise left unrated unless the platform runs a backfill for your organization.One of
chargednot_connectedwaivedunrated
childCallIdstring (uuid) | nulltransfer.*,leg.*: the call that carries the other party’s leg (GET /v1/calls/{childCallId}), when there is one.codestring | nullThe machine code why, when there is one —
flow_step.ended(an AI step’sAI_PROVIDER_UNAVAILABLE,AI_AGENT_UNAVAILABLE,AI_CALLS_DISABLED,AI_PROVIDER_FAILEDorBILLING_…code),ai_step.refused(why the step was refused before the agent took the caller),transfer.failed(NO_ANSWER,CALLER_HUNG_UP,DIAL_REFUSED, …),queue.left(TIMED_OUT,ABANDONED,CALLBACK_REQUESTED,OVERFLOWED).failurePublicCallFailure | nullended: why the call did not complete — the call’s ownfailure; null when it completed.2 fields of
failurecodestringRequiredStable machine value:
NO_ANSWER,BUSY,CANCELLED, or a failure code.reasonstringRequiredA plain-language reason.
fallbackbooleanflow_step.ended: true when the step did not get what it was for and the flow took its failure path — an AI step whose agent could not run (itsonEscalate, or the next verb), aconnectnobody answered (onNoAnswer), a timed-outgather.flowIdstring (uuid)application.fallback: itsfallbackFlowId, the call flow that ran instead of the apology.maxDurationSecondsinteger | nullceiling.reached: the ceiling the call ran to (maxDurationSec), in seconds.nextNodestring | nullflow_step.ended: the node the step branched to; null when the flow carried on with the next verb, or the step ended the call.nodestring | nullflow_step.*,ai_step.*: the node of the stored flow it ran in; null for a step of an answer URL’s document.outcomestringflow_step.ended: what came of it.ai:ended,handed_back,escalated,max_duration,failed;connect:connected(a number or client that hung up after),accepted(an agent took the call), or the leg’sno_answer,busy,failed,declined, …;enqueue:connected,timeout,full,closed,no_agents,callback_requested,overflowed;gather:input,timeout,speech_unavailable;menu:option,invalid,timeout;hours:open,closed,holiday. Never the digits pressed or the words heard.phasestring | nulltranscription.unavailable: how the speech-to-text was lost —unconfigured(none here),connect(it would not start),dropped(it stopped mid-call).One of
unconfiguredconnectdroppedqueueIdstring (uuid) | nullqueue.*, andtransfer.*to a queue: the queue.recordingbooleanrecording.resumed: whether the call records again — another hand may still hold its pause (an agent’s pause outlasts a key’s resume).rolestringleg.*: who joined or left — a deskagent, or apartydialled into the call (a transfer target, a conference party).One of
agentpartystatusstringended: the call’s status once over.One of
queuedinitiatingringingin_progressendingcompletedbusyno_answercancelledfailedstepintegerflow_step.*,ai_step.*: the step’s count on this run of the flow, from 1.targetstringtransfer.*: who it goes to.One of
agentqueuenumbertostring | nulltransfer.*to a number: the number, masked to its last four digits astois on a call.transferTypestringtransfer.*: the kind of transfer.One of
blindwarmverbstringflow_step.*: the verb (say,gather,ai,connect, …).waitedSecondsinteger | nullqueue.left: seconds the caller waited.
idstring (uuid)RequiredThe entry’s id (for
rated, the charge’s).objectstringRequiredOne of
call_timeline_eventoccurredAtstring (date-time)Requiredsequenceinteger | nullRequiredThe entry’s place on the call’s timeline, rising; null for
rated, which is always last.typestringRequiredWhat happened. The call:
created,queued(the carrier has the dial),ringing,answered,ended(status,failure),held,resumed. Its flow:flow_step.started(step,node,verb),flow_step.ended(outcome,fallback,code,nextNode),ai_step.admitted(agentId) andai_step.refused(agentId,code). The desk:queue.entered,queue.connected,queue.left(code,waitedSeconds). Transfers and legs:transfer.started,transfer.ringing,transfer.consulting,transfer.completed,transfer.cancelled,transfer.failed(transferType,target,to,childCallId,code),leg.joined,leg.left(role,childCallId). Andrecording.paused,recording.resumed(by,recording),transcription.unavailable(phase),transcription.recovered,ceiling.reached(maxDurationSeconds),application.fallback(T9:applicationId,flowId,code— the answer URL could not be used, so its fallback flow ran),rated(charge). v1 adds types over time: skip one you do not know.One of
createdqueuedringingansweredendedheldresumedflow_step.startedflow_step.endedai_step.admittedai_step.refusedqueue.enteredqueue.connectedqueue.lefttransfer.startedtransfer.ringingtransfer.consultingtransfer.completedtransfer.cancelledtransfer.failedleg.joinedleg.leftrecording.pausedrecording.resumedtranscription.unavailabletranscription.recoveredceiling.reachedapplication.fallbackrated
nextCursorstring | nullRequiredPass back as
cursorfor the next page; null on the last.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such call, or a call of the other mode (a live call to a test key, a test call to a live key).429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/calls/CALL_ID/events' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"data": [
{
"callId": "CALL_ID",
"data": {
"agentId": "AGENT_ID",
"applicationId": "APPLICATION_ID",
"by": "api",
"charge": {
"amountMinor": 180,
"chargedMinutes": 3,
"currency": "INR",
"includedMinutes": 0,
"ratePerMinuteMinor": 60,
"ratedAt": "2026-11-05T10:00:00.000Z",
"reason": null,
"rule": null,
"status": "charged"
},
"childCallId": "CHILD_CALL_ID",
"code": "AI_PROVIDER_UNAVAILABLE",
"failure": {
"code": "NO_ANSWER",
"reason": "REASON"
},
"fallback": true,
"flowId": "FLOW_ID",
"maxDurationSeconds": 1,
"nextNode": "human",
"node": "main",
"outcome": "failed",
"phase": "unconfigured",
"queueId": "QUEUE_ID",
"recording": true,
"role": "agent",
"status": "queued",
"step": 2,
"target": "agent",
"to": "•••• ••3210",
"transferType": "blind",
"verb": "ai",
"waitedSeconds": 1
},
"id": "ID",
"object": "call_timeline_event",
"occurredAt": "2026-11-05T10:00:00.000Z",
"sequence": 4,
"type": "created"
}
],
"nextCursor": "NEXT_CURSOR"
}Hangup call
post
Ends a live call.
Asks the carrier — or, on a channel with no remote hang-up, the server carrying the call’s stream — to end the call, and answers it as ending; the terminal status and call.completed (with hangup.side: agent and this key as hangup.apiKeyId) follow. A call already over is answered as it stands, so a repeat is safe, and a live call stays endable after calling is switched off for the organization. Refused with 409 HANGUP_NOT_READY (retry after retryAfterSeconds, also sent as Retry-After) when the call cannot be ended yet, 409 HANGUP_UNSUPPORTED when its channel can never end it remotely, and 503 HANGUP_FAILED when the carrier did not confirm — the line is still up; retry. Any key of the organization may end a test call — the sandbox’s, which touches no person, carrier or wallet, and holds one of the organization’s test-call slots until it ends — but a test key never ends a live call: to it a live call answers 404, exactly as an unknown id.
Access: an organization key with the calls:write scope.
Path parameters
callIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. This endpoint converges when run again, so a 5xx stores nothing either: a retry with the same key runs it again. 1–255 visible ASCII characters; kept for 24 hours.
Response 200PublicCall
Its fields are listed under Get call.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such call, or a live call to a test key (any key ends a test call, through its sandbox).409HANGUP_NOT_READY (retryAfterSeconds, also asRetry-After) — the call can be ended, but not yet: the carrier has not given it the id it is ended by, or its stream has not opened (the contact has not answered). Retry; or HANGUP_UNSUPPORTED — the call’s channel can never end it remotely (no remote hang-up and no stream to close); or IDEMPOTENCY_KEY_IN_FLIGHT.422IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).503HANGUP_FAILED — the carrier, or the node carrying the call’s stream, did not confirm; the line is still up. Retry (with the same Idempotency-Key: this endpoint is re-runnable).
curl -X POST 'https://api.trovacast.com/v1/calls/CALL_ID/hangup' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"agent": {
"audio": {
"encoding": "pcm_s16le",
"sampleRate": 16000
},
"maxDurationSec": 1,
"streamUrl": "STREAM_URL"
},
"aiAgentId": "AI_AGENT_ID",
"answeredAt": "2026-11-05T10:00:00.000Z",
"bridge": {
"agentMembershipId": "AGENT_MEMBERSHIP_ID",
"numberLast4": "0000",
"phoneId": "PHONE_ID",
"ringFirst": "contact",
"target": "number"
},
"charge": {
"amountMinor": 180,
"chargedMinutes": 3,
"currency": "INR",
"includedMinutes": 0,
"ratePerMinuteMinor": 60,
"ratedAt": "2026-11-05T10:00:00.000Z",
"reason": null,
"rule": null,
"status": "charged"
},
"contactId": "CONTACT_ID",
"createdAt": "2026-11-05T10:00:00.000Z",
"direction": "inbound",
"durationSeconds": 1,
"endedAt": "2026-11-05T10:00:00.000Z",
"failure": {
"code": "NO_ANSWER",
"reason": "REASON"
},
"flow": {
"applicationId": "APPLICATION_ID",
"callFlowId": "CALL_FLOW_ID",
"source": "definition"
},
"from": "+918031152580",
"fromSource": "organization_number",
"hangup": {
"apiKeyId": "API_KEY_ID",
"reason": "api-hangup",
"side": "agent"
},
"id": "ID",
"initiatedAt": "2026-11-05T10:00:00.000Z",
"legRole": "primary",
"livemode": true,
"machineDetection": {
"detectedAt": "2026-11-05T10:00:00.000Z",
"mode": "detect",
"result": "human"
},
"metadata": {},
"mode": "external_agent",
"numberId": "NUMBER_ID",
"object": "call",
"parentCallId": "PARENT_CALL_ID",
"provider": "airtel",
"purpose": "service",
"recording": {
"durationSeconds": 1,
"expiresAt": "EXPIRES_AT",
"format": "audio/mpeg",
"id": "ID",
"noticePlayed": true,
"purpose": "call",
"status": "pending",
"url": "URL"
},
"recordingEnabled": true,
"reference": "REFERENCE",
"ringingAt": "2026-11-05T10:00:00.000Z",
"rootCallId": "ROOT_CALL_ID",
"status": "queued",
"to": "•••• ••3210",
"updatedAt": "2026-11-05T10:00:00.000Z"
}Get call recording
get
Mints a download link to a call’s recording.
The call’s newest recording — or the one recordingId names (a voicemail beside the call’s own) — with a download url signed for this request: short-lived (expiresAt) and audited against the key, so ask again for a fresh one rather than storing it. purpose says whether it is the call or a voicemail, noticePlayed whether a recording notice played before it started. A call with no recording (or none with that id) answers 404; 409 RECORDING_NOT_AVAILABLE (status: pending, processing or failed) until it is stored — call.recording.ready says when — or after storing it failed; 503 SERVICE_UNAVAILABLE when recording storage cannot sign a link right now (retry).
Access: an organization key with the recordings:read scope.
Path parameters
callIdstringRequired
Query parameters
recordingIdstring (uuid)One recording of the call by its id — a voicemail’s
recordingId(call.missed,call.voicemail.ready) beside the call’s own. The call’s newest recording when unset.
Response 200PublicCallRecordingLink
Show the 10 fieldsHide the fields
callIdstring (uuid)RequireddurationSecondsinteger | nullRequiredexpiresAtstring (date-time)RequiredWhen
urlstops working (PUBLIC_API_RECORDING_URL_TTL_SECONDS, 15 minutes by default).formatstring | nullRequiredidstring (uuid)RequirednoticePlayedbooleanRequiredA recording notice (a call flow’s
notice) played before the platform started this recording. False when none did, and for a carrier’s own copy of the call, which starts with the call.objectstringRequiredOne of
call_recordingpurposestringRequiredWhat it is of:
call— the call itself (the carrier’s or the stream’s copy, a call flow’srecord, aconnectthat recorded its conversation) — orvoicemail, a message the caller left.One of
callvoicemailstatusstringRequiredOne of
availableurlstringRequiredA signed download link, minted for this request and audited against your key. A bearer credential: fetch the audio and discard it; ask again for a fresh one.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such call (a test call, to a live key), or the call has no recording (none with thatrecordingId).409RECORDING_NOT_AVAILABLE (status:pending,processingorfailed) — not stored yet (wait forcall.recording.ready), or it failed.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).503Recording storage cannot sign a link right now; retry.
curl 'https://api.trovacast.com/v1/calls/CALL_ID/recording' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"callId": "CALL_ID",
"durationSeconds": 1,
"expiresAt": "2026-11-05T10:00:00.000Z",
"format": "audio/mpeg",
"id": "ID",
"noticePlayed": true,
"object": "call_recording",
"purpose": "call",
"status": "available",
"url": "URL"
}Delete call recording
delete
Permanently erases a call’s recordings.
Destroys the stored audio of every recording of the call, one still being stored included — storage keeps no versions, so nothing can restore it — then the records, auditing each erasure against the key; the call reads recording: null afterwards. Idempotent: a repeat answers 204 again, so a retry is always safe. A call that never had a recording answers 404; 503 SERVICE_UNAVAILABLE when storage could not delete the audio (audited as a failed erasure, and nothing reads as erased that is not; retry).
Access: an organization key with the recordings:write scope.
Path parameters
callIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. This endpoint converges when run again, so a 5xx stores nothing either: a retry with the same key runs it again. 1–255 visible ASCII characters; kept for 24 hours.
Response 204
Erased — or already erased by an earlier request (a repeat is answered the same).
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such call (a test call, to a live key), or the call never had a recording.409IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running (retry afterRetry-After); or CONFLICT.422IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).503Recording storage could not delete the audio right now (audited as a failed erasure); nothing claims to be erased that is not. Retry.
curl -X DELETE 'https://api.trovacast.com/v1/calls/CALL_ID/recording' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"Answers 204 with no body.
Get call summary
get
Reads the AI’s summary, outcome and sentiment of a call.
What the platform’s AI made of the finished call — summary (spoken numbers masked to the last four digits), disposition, sentiment, confidence, a suggested followUpAt, and the AI agent’s post-call extraction — beside outcome, which takes the agent’s filed wrap-up (source: agent) over the AI’s verdict. status is pending until the call ends and grading runs (call.summary.ready fires when it is written), then ready, or unavailable when grading produced nothing (no transcript to grade, no AI provider) or never runs (a test call). A key reads the calls of its own mode only: a call of the other mode — a live call to a test key, a test call to a live key — answers 404, exactly as an unknown id.
Access: an organization key with the transcripts:read scope.
Path parameters
callIdstringRequired
Response 200PublicCallSummary
Show the 12 fieldsHide the fields
analyzedAtstring (date-time) | nullRequiredWhen the AI graded the call.
callIdstring (uuid)Requiredconfidencenumber | nullRequiredThe AI’s confidence in its verdict.
0–1
dispositionstring | nullRequiredThe AI’s verdict on how the call went.
One of
interestednot_interestedcallback_requestedsale_agreeddo_not_call_requestedwrong_numbervoicemailno_decisionextractionPublicCallExtraction | nullRequiredWhat the call’s AI agent extracted with its extraction schema (
/v1/agentsextraction); null when its agent has none.5 fields of
extractiondataobject | nullRequiredThe data, matching the agent’s extraction schema; phone numbers in it masked to their last four digits. Null unless
ready.extractedAtstring (date-time) | nullRequiredfailureCodestring | nullRequiredPROVIDER_FAILED (the reasoning provider could not be reached), DECLINED (it refused or answered nothing), INVALID_OUTPUT (its answer did not match the schema, and was discarded), UNREADABLE (stored under a retired key).
One of
PROVIDER_FAILEDDECLINEDINVALID_OUTPUTUNREADABLEmockbooleanRequiredTrue when no provider extracted it: a test call’s extraction is the sandbox’s own, filled from its scripted conversation to the agent’s schema (mock output to build against). False on every live call.
statusstringRequiredready(data set),failed(failureCodesays why),pending(not yet run — it runs with the summary),unavailable(never will: no transcript, or no reasoning provider).One of
readyfailedpendingunavailable
followUpAtstring (date-time) | nullRequiredA callback time the contact asked for (“tomorrow at 2”), resolved in the organization’s time zone.
mockbooleanRequiredTrue when no AI graded the call: an AI agent’s test call ends with the sandbox’s own summary of its scripted conversation (and, for an agent with an extraction schema, its extraction), labelled as mock output, so
call.summary.readycan be built against before going live. False on every live call.objectstringRequiredOne of
call_summaryoutcomePublicCallOutcome | nullRequiredThe call’s outcome as the platform reports it: the agent’s wrap-up when one was filed, else the AI’s verdict.
4 fields of
outcomecodestring | nullThe organization’s own wrap-up code the agent filed (its slug), when it filed one —
valueis then the standard outcome the code counts as. Null for a standard outcome and for the AI’s verdict.labelstring | nullThat code’s label as the agent picked it (a code renamed since still reads as filed). Null whenever
codeis.sourcestringRequiredagentwhen a person filed the wrap-up (it supersedes the AI’s verdict), elseai.One of
agentaivaluestringRequiredOne of the eight standard outcomes. When the agent filed one of the organization’s own wrap-up codes, the standard outcome that code counts as (
codenames the code).One of
interestednot_interestedcallback_requestedsale_agreeddo_not_call_requestedwrong_numbervoicemailno_decision
sentimentstring | nullRequiredThe contact’s mood over the call, as the AI read it.
One of
positiveneutralnegativestatusstringRequiredpendingwhile the call is live or still being finalized;readyonce final;unavailablewhen it is final and there is none (nothing was transcribed or graded — a call that was not answered, a channel without a media stream, a deployment without speech-to-text or an AI provider, a test call).One of
pendingreadyunavailablesummarystring | nullRequiredThe AI’s account of the conversation, phone numbers masked to their last four digits.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such call, or a call of the other mode (a live call to a test key, a test call to a live key).429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/calls/CALL_ID/summary' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"analyzedAt": "2026-11-05T10:00:00.000Z",
"callId": "CALL_ID",
"confidence": 0,
"disposition": "interested",
"extraction": {
"data": {
"callbackRequested": true,
"preferredDate": "2026-11-07"
},
"extractedAt": "2026-11-05T10:00:00.000Z",
"failureCode": "PROVIDER_FAILED",
"mock": true,
"status": "ready"
},
"followUpAt": "2026-11-05T10:00:00.000Z",
"mock": true,
"object": "call_summary",
"outcome": {
"code": "demo_booked",
"label": "Demo booked",
"source": "agent",
"value": "interested"
},
"sentiment": "positive",
"status": "pending",
"summary": "SUMMARY"
}Get call transcript
get
Reads a call’s transcript, oldest first.
Final segments only — speaker, timing and text, with phone-number-shaped runs masked to the last four digits — paged with limit and cursor. While the call is live status is pending and the pages hold what has been transcribed so far; it reads ready once complete (call.transcript.ready fires then) and unavailable when there is no transcript. A key reads the calls of its own mode only: a call of the other mode — a live call to a test key, a test call to a live key — answers 404, exactly as an unknown id.
Access: an organization key with the transcripts:read scope.
Path parameters
callIdstringRequired
Query parameters
limitintegerHow many items to return.
cursorstringThe
nextCursorof the previous page. Omit for the first page.
Response 200PublicCallTranscript
callIdstring (uuid)RequireddataPublicTranscriptSegment[]RequiredOldest first. While the call is live this is what has been transcribed so far.
11 fields of
dataconfidencenumber | nullRequiredThe transcriber’s confidence, when it reported one.
0–1
createdAtstring (date-time)RequiredendMsintegerRequiredMilliseconds from when the call was created.
idstring (uuid)Requiredlanguagestring | nullRequiredThe language the transcriber reported, when it did.
objectstringRequiredOne of
transcript_segmentrevisionintegerRequired1 as transcribed; a correction would be a higher revision of the same
sequence, listed after it.sequenceintegerRequiredThe segment’s place in the call, from 1.
speakerstringRequiredcontact(the call’s contact),agent(a person on the desk),ai(the AI agent),supervisor,platform, orunknown— a turn the platform could not attribute (a carrier stream that mixes agent and contact).One of
contactagentaisupervisorplatformunknownstartMsintegerRequiredMilliseconds from when the call was created.
textstring | nullRequiredWhat was said. A phone number spoken on the call is masked to its last four digits. Null when the stored text cannot be read.
finalizedAtstring (date-time) | nullRequiredWhen the platform declared the transcript complete (
call.transcript.ready); null until then.gapsPublicTranscriptGap[]RequiredWhen the call’s speech-to-text was down, oldest first; empty when it never was. Speech in a gap was not transcribed — a
readytranscript with gaps is a partial one. Recorded from the moment an outage is seen, so a live call’s gaps are readable while it is up.3 fields of
gapsendedAtstring (date-time) | nullRequiredWhen transcription came back; null while it is still down, or when it did not come back before the call ended.
phasestringRequiredunconfigured(the speech-to-text the call selects has no credential here — not retried),connect(it could not be reached),dropped(it failed mid-call). The platform retriedconnectanddroppedwith backoff.One of
unconfiguredconnectdroppedstartedAtstring (date-time)Required
nextCursorstring | nullRequiredPass back as
cursorfor the next page; null on the last.objectstringRequiredOne of
call_transcriptstatusstringRequiredpendingwhile the call is live or still being finalized;readyonce final;unavailablewhen it is final and there is none (nothing was transcribed or graded — a call that was not answered, a channel without a media stream, a deployment without speech-to-text or an AI provider, a test call).One of
pendingreadyunavailableunavailableReasonstring | nullRequiredWhy
statusisunavailable(null otherwise), the first that applies:disabled— the platform does not transcribe this call (a test call no AI agent runs: the sandbox carries no audio; an external-agent call: your own agent hears it);too_short— it ended before it was answered, or nothing was said long enough to transcribe;processing_failed— speech was transcribed but could not be stored;stt_unavailable— the speech-to-text was down on the call (gapssays when) and nothing was transcribed;not_recorded— no audio of the call reached the platform (its channel does not stream the call, or its stream never opened).One of
disabledtoo_shortprocessing_failedstt_unavailablenot_recorded
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such call, or a call of the other mode (a live call to a test key, a test call to a live key).429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/calls/CALL_ID/transcript' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"callId": "CALL_ID",
"data": [
{
"confidence": 0,
"createdAt": "2026-11-05T10:00:00.000Z",
"endMs": 1,
"id": "ID",
"language": "en-IN",
"object": "transcript_segment",
"revision": 1,
"sequence": 1,
"speaker": "contact",
"startMs": 1,
"text": "TEXT"
}
],
"finalizedAt": "2026-11-05T10:00:00.000Z",
"gaps": [
{
"endedAt": "2026-11-05T10:00:00.000Z",
"phase": "unconfigured",
"startedAt": "2026-11-05T10:00:00.000Z"
}
],
"nextCursor": "NEXT_CURSOR",
"object": "call_transcript",
"status": "pending",
"unavailableReason": null
}