Jump to

  • Quickstarts
  • API reference
  • Webhook events
  • Error codes
  • SDKs

API reference

Calls

How these fit together: the Calls guide.

List calls

get/v1/calls

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

  • limitinteger

    How many items to return.

  • cursorstring

    The nextCursor of the previous page. Omit for the first page.

  • statusstring

    One ofqueuedinitiatingringingin_progressendingcompletedbusyno_answercancelledfailed

  • contactIdstring (uuid)

  • directionstring

    One ofinboundoutbound

  • createdAfterstring (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 updatedAt is at or after this instant, OLDEST change first (by updatedAt, then id). 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 with nextCursor; when it is null, resume later from the last updatedAt you saw and dedupe by id + status.

  • includestring

    legs also lists the legs dialled from live calls (transfer targets, conference parties, bridged numbers — parentCallId set). Omitted: root calls only.

    One oflegs

  • rootCallIdstring (uuid)

    Only the calls of this call graph (its root and every leg dialled from it). Implies include=legs.

  • metadatastring[]

    Calls whose metadata holds this key with exactly this value, written key:value (the first : splits; values may contain more) — a /v1 call’s own metadata, or the metadata of 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 with updatedAfter. Indexed, so it is as cheap as the plain list.

Response 200PublicCallPage

  • dataPublicCall[]Required

    Its fields are listed under Get call

  • nextCursorstring | nullRequired

    Pass back as cursor for the next page; null on the last.

Errors

Request
curl 'https://api.trovacast.com/v1/calls?status=completed&limit=50' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/calls

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-Keystring

    Makes 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

  • agentPublicCallAgentRequest

    Required with mode: EXTERNAL_AGENT (a request without it is 400), refused with any other mode.

    3 fields of agent
    • audioPublicCallAgentAudioRequired

      2 fields of audio
      • encodingstringRequired

        One ofpcm_s16le

      • sampleRateintegerRequired

        One of16000

    • streamUrlstringRequired

      The 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

    • tokenstringRequired

      Sent as Authorization: Bearer <token> on the upgrade. Opaque to the platform, stored sealed, never returned.

      at most 512 characters

  • aiAgentPublicCallAiAgentRequest

    Required with mode: AI_AGENT, refused with any other mode.

    9 fields of aiAgent
    • agentIdstring (uuid)Required

      One of the organization’s AI agents (GET /v1/agents): its voice, model and instructions run the conversation.

    • firstMessagestring

      What 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

    • instructionsstring

      The agent’s instructions for this call, in place of its own (its language and the call’s objective are still added). Stored sealed with the call.

      1–20000 characters

    • objectivestring

      What 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

    • onMachinestring

      T5 — 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. Implies machineDetection: detect when the request names none (a channel without machine detection is 422 MACHINE_DETECTION_UNSUPPORTED). continue (default): the agent speaks to whoever answered. In test mode the verdict is sandbox.machine.

      One ofcontinuehangup

      default "continue"

    • optOutPublicAiOptOut

      The built-in opt-out: the caller presses key or says one of phrases, and at once the contact is marked do-not-call (call.ai.opt_out tells it), the agent says reply and the call ends. A key or phrases, or both.

      3 fields of optOut
      • keystring

        The key that opts the caller out.

        One of0123456789*#

      • 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

      • replystring

        Said to the caller, in the agent’s voice, before the call ends.

        at most 500 charactersdefault "Understood. We will not call you again. Goodbye."

    • sessionPublicAgentSession

      Your 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 session
      • timeoutSecondsinteger

        How long the caller may wait for your answer, in seconds. They hear silence meanwhile.

        1–10default 5

      • urlstringRequired

        Your HTTPS endpoint, asked once when the conversation starts: a POST of { event: "agent.session", requestId, agentId, callId, source, call, timestamp } (source: call, number_route or flow_step; call the tool call’s context), signed with the agent’s tool-signing secret (Trovacast-Signature). Answer 2xx JSON (at most 64 KB) with any of firstMessage (null: none), firstSpeaker, instructions, language, endCallPhrases, maxTurns, tools, transfer and optOut — 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 with POST /v1/agents/{agentId}/tool-secret).

      at most 10 items

      4 fields of tools
      • descriptionstringRequired

        When the model should use it — the model reads this.

        1–1000 characters

      • namestringRequired

        What the model calls it: a letter, then letters, digits, _ or - (at most 64). Unique within the call.

      • parametersobjectRequired

        The arguments, as an object schema — the JSON Schema subset an agent’s own tools take (POST /v1/agents).

      • urlstringRequired

        Your 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, answered 2xx within 4 seconds. The URL rules of webhook endpoints apply.

        at most 2048 characters

    • transferPublicAiTransfer

      A person the agent may hand the caller to: the agent is offered a transfer_to_person tool, 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.transfer says what came of it. Exactly one of number or phoneId (a route takes phoneId only).

      4 fields of transfer
      • numberstring

        An 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/calls only — 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.

      • ringTimeoutSecondsinteger

        How long the person rings before the caller goes back to the agent.

        5–120default 30

      • whisperstring

        Spoken to the person who answers, before they are connected.

        at most 500 characters

  • bridgePublicCallBridgeRequest

    Required with mode: BRIDGE, refused with any other mode.

    6 fields of bridge
    • noAnswerMessagestring

      Spoken to the contact when the target does not answer, before the call ends.

      at most 500 characters

    • promptstring

      Spoken to the contact (speech synthesis) while the target rings.

      at most 500 characters

    • ringFirststring

      Who is rung first. contact (default): the contact is dialled, then connected to to. agent (click-to-call, to.agentMembershipId or — 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, so prompt, whisper and noAnswerMessage are refused with it.

      One ofcontactagent

      default "contact"

    • ringTimeoutSecinteger

      How long the target rings before the bridge gives up.

      5–120default 30

    • toPublicCallBridgeTargetRequired

      3 fields of to
      • agentMembershipIdstring (uuid)

        A seat in the organization (an organization membership id): the call is offered to that agent’s softphone.

      • numberstring

        An 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. With ringFirst: 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 is 400 VALIDATION_FAILED.

    • whisperstring

      Spoken to the target only, before they are connected (who is calling, why).

      at most 500 characters

  • calledPartyTimeZonestring

    The 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)

  • flowPublicCallFlowRequest

    Required with mode: FLOW, refused with any other mode.

    4 fields of flow
    • answerUrlstring

      With applicationId only: 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.

    • definitionobject

      An inline call-flow document ({ "version": 1, "start": "…", "nodes": { … } }, the grammar of POST /v1/call-flows; JSON Schema CallFlowDocument), validated — grammar, size and every queue, schedule, seat, AI agent and caller ID it names — before anything dials. At most 64 KB.

  • fromstring

    The 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); elsewhere 422 CALLER_ID_UNSUPPORTED, and a number the organization does not own there 422 CALLER_ID_NOT_OWNED. Omitted: the channel’s own caller ID.

  • machineDetectionstring

    Ask the carrier to tell an answering machine from a person once the call is answered. detect: the call goes ahead and the verdict arrives as call.machine_detected (and on the call as machineDetection.result). detect_and_hangup: the carrier ends the call when a machine answers (failure names it). Only on a channel with machineDetection: true in GET /v1/calls/channels; elsewhere 422 MACHINE_DETECTION_UNSUPPORTED. In test mode the verdict is the one sandbox.machine scripts (none, no call.machine_detected).

    One ofdetectdetect_and_hangup

  • maxDurationSecintegerRequired

    Hard 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 (stop with reason max_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 is 400. The carrier’s own limit is set 75 s past it, so the prepaid balance must cover maxDurationSec + 75 seconds 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 start frame of the agent stream. At most 20 keys (1–40 of A-Za-z0-9_.-), values ≤ 500 characters. Never put personal data here: it is stored unencrypted.

  • modestringRequired

    What runs the conversation once the contact answers. EXTERNAL_AGENT: the platform streams the call’s audio to your agent.streamUrl and 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 ofEXTERNAL_AGENTFLOWAI_AGENTBRIDGEexternal_agentflowai_agentbridge

  • notAfterstring

    T5 — 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_PASSED and creates nothing; a call that could not be handed to the carrier before it (it is checked again right before the dial) ends failed with failure.code: NOT_AFTER_PASSED, nothing rung. A retry of a request that already placed its call still answers that call.

  • providerstring

    Which carrier to dial over (GET /v1/calls/channels lists 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, is 409 CHANNEL_NOT_CONFIGURED.

    One ofairtelexotelplivotelnyxtwilio

  • purposestring

    What the call is for under TRAI/DLT rules, checked before the dial: a PROMOTIONAL call needs an assigned 140-series number as from, a verified voice header and the 09:00–21:00 window in the called party’s zone; a 140-series from is for PROMOTIONAL calls only. Omitted: undeclared (never read as promotional). Either case is accepted; the documented spelling is canonical (what responses answer).

    One ofSERVICETRANSACTIONALPROMOTIONALservicetransactionalpromotional

  • recordingPublicCallRecordingRequestRequired

    2 fields of recording
    • consentEvidencePublicCallConsentEvidence

      3 fields of consentEvidence
      • capturedAtstring (date-time)Required

        When the contact consented; never in the future.

      • sourcestringRequired

        How the contact consented. Either case is accepted; the documented spelling is canonical (what responses answer).

        One ofWEB_FORMWRITTENVERBALOTHERweb_formwrittenverbalother

      • textstringRequired

        The consent text the contact saw or heard. Stored encrypted as the evidence.

        at most 2000 characters

    • enabledbooleanRequired

      Record the call. An organization whose policy records every call records it regardless; either way a recorded call needs consentEvidence.

  • referencestring

    Your 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 what POST /v1/calls/cancel ends calls by. Not unique: every call you give one carries it. Never put personal data here: it is stored unencrypted.

    at most 200 characters

  • respectCallingWindowboolean

    Place 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_CLOSED with nextAllowedAt.

    default true

  • ringTimeoutSecinteger

    How long the contact’s phone rings before the attempt is given up (carrier permitting).

    5–120

  • sandboxPublicCallSandbox

    T8 — 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). A FLOW, BRIDGE or AI_AGENT test call plays it on the platform’s real call logic. See Integration testing.

    6 fields of sandbox
    • aiPublicSandboxAiScript

      The mock AI agent’s conversation when an agent takes the caller (an ai route, a flow’s ai step, an AI_AGENT call). Absent, it plays a short scripted conversation and closes.

      1 field of ai
      • turnsPublicSandboxAiTurn[]Required

        The conversation, in order (at most 50 turns). After the last, the agent closes the call.

        8 fields of turns
        • agentstring

          The agent says this.

        • argumentsobject

          The tool call’s arguments (checked against its schema).

        • callerstring

          The caller says this (one of the call’s opt-out phrases opts them out).

        • endboolean

          true: the agent ends the conversation (its closing line said).

        • hangUpboolean

          true: the caller hangs up.

        • pressstring

          The caller presses a key (call.dtmf); the call’s opt-out key opts them out.

        • toolstring

          The 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.

        • transferPublicSandboxTransfer

          The agent hands the caller to a person: the call’s transfer target (an AI call or route) — or, in a flow’s ai step, its onEscalate.

          3 fields of transfer
          • answeredboolean

            The person answers (default true).

          • reasonstring

            Why the agent asked (kept, never spoken).

          • talkSecondsinteger

            How 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 connects
      • agentMembershipIdstring (uuid)

        A queue’s wait answered: the seat (membership id) that takes the caller; default the queue’s first member.

      • answeredByinteger

        Numbers rung at once (strategy: simultaneous): which answered, by its place in targets (0-based; default 0).

      • confirmboolean

        Pressed the confirm key when the step asks one (confirm). Default true; false is a pickup that never confirmed — no answer.

      • hangsUpstring

        Who ends the conversation: the caller (default — the call ends) or the party (the flow goes on).

        One ofcallerparty

      • outcomestring

        Default no_answer.

        One ofansweredno_answerbusyfailed

      • ringSecondsinteger

        How long it rang (default 5 when answered, else the step’s ring time). Answered later than the step rings for is no answer.

      • talkSecondsinteger

        How long they talked once connected (default 30).

    • hangUpAfterSecondsinteger

      The 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 inputs
      • afterSecondsinteger

        When, in seconds after the prompt (default 1). Past the gather’s timeoutSeconds the gather times out first and this answers the next one, with what is left.

      • digitsstring

        Keys pressed (0-9, *, #), in order.

      • hangUpboolean

        The caller hangs up here instead.

      • speechstring

        What the caller says — heard by a speech gather, and a line of the call’s transcript.

    • machinestring

      The answering-machine verdict, for a call that asks for machineDetection (or aiAgent.onMachine: hangup): call.machine_detected, the flow’s amd variable, and — machine — the call ended without a word where it says to.

      One ofhumanmachineunknown

    • recordingsPublicSandboxRecording[]

      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 recordings
      • keystring

        A key pressed to end it: one of a voicemail’s keys, or the finish key.

      • secondsinteger

        How long it runs (default: the speech at 2.5 words a second). Held to the step’s maxSeconds.

      • speechstring

        What they say: the voicemail’s transcript.

      • thenstring

        After it: hang up (default) or stay on the line.

        One ofhang_upstay

  • statusCallbackPublicStatusCallback

    Also 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 statusCallback
    • eventsstring[]

      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 ofmessage.sentmessage.deliveredmessage.readmessage.failedcall.queuedcall.ringingcall.answeredcall.completedcall.failedcall.no_answercall.busy

    • urlstringRequired

      Where 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

  • toPublicCallRecipient

    1 field of to
    • phonestringRequired

      International format. The contact with this number is used, or created (needs contacts:write as well).

Response 201PublicCall

Its fields are listed under Get call.

Errors

Request
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"
  }
}'
Response 201 (json)
{
  "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/v1/calls/cancel

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-Keystring

    Makes 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

  • referencestringRequired

    The reference the calls were placed with.

    1–200 characters

Response 200PublicCallCancellation

  • callsPublicCallCancellationItem[]Required

    Every call of the key’s mode placed with the reference, newest first (at most 50).

    2 fields of calls
    • callPublicCallRequired

      Its fields are listed under Get call

    • outcomestringRequired

      cancelled: 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 ofcancelledendedpendingunsupported

  • objectstringRequired

    One ofcall_cancellation

  • referencestringRequired

Errors

Request
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"
}'
Response 200 (json)
{
  "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/v1/calls/channels

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[]Required

    12 fields of data
    • agentFirstbooleanRequired

      The channel can ring an agent’s phone first and then bridge the contact in (mode: BRIDGE with bridge.ringFirst: agent). False: that is 422 CHANNEL_UNSUPPORTED on it.

    • callerIdSelectionbooleanRequired

      POST /v1/calls may name from: the channel publishes the organization’s numbers, so a chosen caller ID can be checked. False: from is 422 CALLER_ID_UNSUPPORTED.

    • defaultbooleanRequired

      Where a call that names no provider dials for this organization.

    • externalAgentbooleanRequired

      The channel can carry mode: EXTERNAL_AGENT (it streams the call’s audio).

    • flowsbooleanRequired

      The channel can carry mode: FLOW and mode: BRIDGE (it streams the call into the platform’s media room). False: those modes are 422 CHANNEL_UNSUPPORTED on it.

    • labelstringRequired

      A display name.

    • machineDetectionbooleanRequired

      The channel can tell an answering machine from a person: POST /v1/calls may send machineDetection on it (elsewhere 422 MACHINE_DETECTION_UNSUPPORTED), and the verdict arrives as call.machine_detected.

    • objectstringRequired

      One ofcall_channel

    • providerstringRequired

      The value POST /v1/calls takes as provider.

      One ofairtelexotelplivotelnyxtwilio

    • readybooleanRequired

      A 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 (or 422 CHANNEL_UNSUPPORTED) would answer.

    • remoteHangupbooleanRequired

      The carrier ends a call on request, ringing or answered. False: POST /v1/calls/:id/hangup ends the call by closing its stream, so a call not yet answered is 409 HANGUP_NOT_READY until it is.

    • sensitiveGatherbooleanRequired

      A sensitive gather (a call action, or a flow’s gather verb) 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

Request
curl 'https://api.trovacast.com/v1/calls/channels' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/calls/{callId}

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 fields
  • agentPublicCallAgent | nullRequired

    3 fields of agent
    • audioPublicCallAgentAudioRequired

      2 fields of audio
      • encodingstringRequired

        One ofpcm_s16le

      • sampleRateintegerRequired

        One of16000

    • maxDurationSecintegerRequired

    • streamUrlstringRequired

  • aiAgentIdstring (uuid) | nullRequired

    The AI agent (GET /v1/agents) that ran an AI call; null for other calls.

  • answeredAtstring (date-time) | nullRequired

  • bridgePublicCallBridgeInfo | nullRequired

    5 fields of bridge
    • agentMembershipIdstring (uuid) | nullRequired

    • numberLast4string | nullRequired

      The bridged number’s last four digits (a number’s, or a phone’s rung after the contact); never the number.

    • phoneIdstring (uuid) | nullRequired

      P7 — the organization’s own phone (/v1/phones) the call bridged, by id; null for any other target.

    • ringFirststringRequired

      Who 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 ofcontactagent

    • targetstringRequired

      number (an outside number), agent (a seat) or — P7 — phone (one of the organization’s own phones, phoneId).

      One ofnumberagentphone

  • chargePublicCallCharge | null

    What 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 charge
    • amountMinorintegerRequired

    • chargedMinutesintegerRequired

      Started minutes billed after the included minutes.

    • currencystringRequired

    • includedMinutesintegerRequired

      Included minutes this call used.

    • ratePerMinuteMinorintegerRequired

    • ratedAtstring (date-time)Required

    • reasonstring | nullRequired

      The 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) or waived; null when there is nothing to say. Plain English for people; switch on rule and status, never on this text.

    • rulestring | nullRequired

      The 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 and reason says both. v1 may add values: read one you do not know as an unexplained rule, by reason.

      One ofSTALL_SILENTSTALL_PAST_CEILINGAI_VOICE_NEVER_STARTEDTALK_TIME_UNKNOWN

    • statusstringRequired

      charged; 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 ofchargednot_connectedwaivedunrated

  • contactIdstring (uuid) | nullRequired

  • createdAtstring (date-time)Required

  • directionstringRequired

    One ofinboundoutbound

  • durationSecondsinteger | nullRequired

  • endedAtstring (date-time) | nullRequired

  • failurePublicCallFailure | nullRequired

    2 fields of failure
    • codestringRequired

      Stable machine value: NO_ANSWER, BUSY, CANCELLED, or a failure code.

    • reasonstringRequired

      A plain-language reason.

  • flowPublicCallFlowInfo | nullRequired

    Where a flow-driven call’s instructions come from: a /v1 FLOW call’s, or (2026-11-06) an inbound call routed to a call flow or a voice application (source: call_flow / application with its id). Null for every other call.

    3 fields of flow
    • applicationIdstring (uuid) | nullRequired

    • callFlowIdstring (uuid) | nullRequired

    • sourcestringRequired

      definition: an inline document (not echoed); call_flow: a stored flow’s published version; application: a voice application’s answer URL.

      One ofdefinitioncall_flowapplication

  • fromstring | nullRequired

    The calling number. Outbound: the organization’s own number the call presents to the contact, in international format (E.164) — the request’s from when 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’s to is; null when they withheld their number.

  • fromSourcestring | nullRequired

    Where an outbound call’s from came from: request (the request’s from), organization_number (a call that named no from, given one of your own numbers on the channel — numberId names it), agent_number (the assigned agent’s allocated number), carrier_account (the caller ID of your own carrier account on the channel) or platform (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, when from is null, and on a call placed before 2026-11-06 22:35 UTC.

    One ofrequestorganization_numberagent_numbercarrier_accountplatform

  • hangupPublicCallHangup | nullRequired

    3 fields of hangup
    • apiKeyIdstring (uuid) | nullRequired

      The API key whose POST …/hangup ended the call (reason: api-hangup); null for any other ending.

    • reasonstring | nullRequired

      What 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 (your hangup frame), max_duration, agent_lost; for a flow (2026-11-06) hangup_verb, instructions_ended, ai_ended, callback_requested, flow_failed and caller_hung_up.

    • sidestringRequired

      agent: your side (a hangup frame on the stream, or POST …/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’s hangup verb, the instructions running out, an ai verb’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 ofagentcontactplatformapplicationunknown

  • idstring (uuid)Required

  • initiatedAtstring (date-time) | nullRequired

  • legRolestringRequired

    primary for a call itself; otherwise what the leg is in its root’s graph. GET /v1/calls lists root calls unless include=legs.

    One ofprimarytransfer_targetconferenceconsultagent_phonecarrier_bleg

  • livemodebooleanRequired

    False when a test-mode (tc_test_…) key created it: it went to a sandbox, never to a real provider, and was never billed.

  • machineDetectionPublicCallMachineDetection | nullRequired

    Answering-machine detection, when the call asked for it (machineDetection); null otherwise.

    3 fields of machineDetection
    • detectedAtstring (date-time) | nullRequired

    • modestringRequired

      What POST /v1/calls asked for (machineDetection).

      One ofdetectdetect_and_hangup

    • resultstring | nullRequired

      The carrier’s verdict once it arrives (call.machine_detected); null before. unknown: the carrier could not tell.

      One ofhumanmachineunknown

  • metadataRecord<string, string>Required

    The metadata you sent, echoed verbatim.

  • modestringRequired

    One ofexternal_agentaimanualhybridflowbridge

  • numberIdstring (uuid) | nullRequired

    The organization’s inventory number on the business side of the call (GET /v1/numbers/{numberId}): the one an inbound call came in on (PATCH it to change where its calls go), or the one an outbound call presents as from. Null when that number is not in the organization’s inventory (a carrier account’s own caller ID, a platform number).

  • objectstringRequired

    One ofcall

  • parentCallIdstring (uuid) | nullRequired

    The call this leg was dialled from (a transfer target, a conference party, a bridged number); null for a root call.

  • providerstringRequired

    One ofairtelexotelplivosimtelnyxtwilio

  • purposestring | nullRequired

    What the call is for under TRAI/DLT rules, as declared (purpose on POST /v1/calls, or the campaign’s); null when undeclared.

    One ofservicetransactionalpromotional

  • recordingPublicCallRecording | nullRequired

    8 fields of recording
    • durationSecondsinteger | nullRequired

    • expiresAtstring | nullRequired

      Always null; see url.

    • formatstring | nullRequired

    • idstring (uuid)Required

    • noticePlayedbooleanRequired

      A 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.

    • purposestringRequired

      What it is of: call — the call itself (the carrier’s or the stream’s copy, a call flow’s record, a connect that recorded its conversation) — or voicemail, a message the caller left.

      One ofcallvoicemail

    • statusstringRequired

      One ofpendingprocessingavailablefaileddeleted

    • urlstring | nullRequired

      Always null: a download link is minted only by GET /v1/calls/:id/recording (scope recordings:read), never on a call read or a webhook.

  • recordingEnabledbooleanRequired

  • referencestring | nullRequired

    Your reference for the call (POST /v1/calls), echoed verbatim; null when it has none.

  • ringingAtstring (date-time) | nullRequired

  • rootCallIdstring (uuid) | nullRequired

    The root of this call’s graph; null for a root call.

  • statusstringRequired

    queued (created, not yet accepted by the carrier) → initiating (the carrier accepted the dial) → ringing → in_progress → (ending) → completed; or busy, no_answer, cancelled, failed.

    One ofqueuedinitiatingringingin_progressendingcompletedbusyno_answercancelledfailed

  • tostring | nullRequired

    The 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 by contactId).

  • updatedAtstring (date-time)Required

Errors

Request
curl 'https://api.trovacast.com/v1/calls/CALL_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/calls/{callId}/actions

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-Keystring

    Makes 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

  • actionstringRequired

    speak (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 ofspeakplaygathersend_dtmfholdresumemuteunmutetransferrecordhangup

  • audioUrlstring

    hold: an https WAV URL played on a loop while held; a soft tone when unset.

    at most 2048 characters

  • digitsstring

    send_dtmf: keys to press on the call: 0-9 * #, w for a half-second pause; at most 32.

  • finishOnKeystring

    gather: the key that ends input early ("": none).

    One of#*

    default "#"

  • hintsstring[]

    gather with 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

  • inputstring

    gather: 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 in call.gather.completed as speech: { text, confidence }; 422 CALL_ACTION_UNSUPPORTED (reason: speech_recognition_unavailable) on a deployment without it.

    One ofdtmfspeechdtmf_speech

    default "dtmf"

  • interDigitTimeoutSecinteger

    gather: seconds allowed between keys. interDigitTimeoutSeconds is accepted as an alias; not both.

    1–30

  • languagestring

    speak: BCP 47 language. gather with speech: the language the caller speaks (recognized in its primary language, en).

  • numDigitsinteger

    gather: stop after this many keys.

    1–32

  • promptPublicCallGatherPrompt

    gather: played first; any key press interrupts it.

    2 fields of prompt
    • textstring

      Spoken (speech synthesis).

      at most 1000 characters

    • urlstring

      An https URL of a WAV file, fetched through the SSRF guard.

      at most 2048 characters

  • ringTimeoutSecinteger

    transfer to a number: how long it rings before the caller is taken off hold again.

    5–120default 30

  • sensitiveboolean

    gather: card numbers, PINs — the digits are never stored, logged or sent (call.gather.completed carries digits: 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 with sensitiveGather: true in GET /v1/calls/channels pauses the carrier’s recording before the action answers (503 RECORDING_PAUSE_FAILED when 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 takes input: speech or dtmf_speech.

    default false

  • speechTimeoutSecinteger

    gather with speech: seconds of quiet after the caller speaks that end their answer (an answer is at most 60 seconds). speechTimeoutSeconds is accepted as an alias; not both.

    1–10default 2

  • statestring

    record: pause the platform’s recording of the call while something sensitive is said, or resume it. One state shared with the agent’s desk: resume releases this key’s pause only (an agent’s pause keeps it paused), and the agent’s Resume releases this key’s pause too.

    One ofpauseresume

  • textstring

    speak: what to say to the call (speech synthesis).

    at most 1000 characters

  • timeoutSecinteger

    gather: seconds to wait for the first key. timeoutSeconds (the call-flow gather verb’s name for it) is accepted as an alias; send one or the other — both together is 400.

    1–60default 5

  • toPublicCallTransferTarget

    transfer: where to.

    4 fields of to
    • applicationIdstring (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).

    • numberstring

      An 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.

  • urlstring

    play: an https URL of a WAV file (at most about five minutes), fetched through the SSRF guard.

    at most 2048 characters

  • voicestring

    speak: a voice id from the speech catalog; the deployment default when unset.

    at most 64 characters

Response 200PublicCallActionResult

  • actionstringRequired

    One ofspeakplaygathersend_dtmfholdresumemuteunmutetransferrecordhangup

  • callPublicCallRequired

    Its fields are listed under Get call

  • callIdstring (uuid)Required

  • idstring (uuid)Required

    This action’s id; the events it leads to (call.gather.completed, call.transferred, call.held, call.resumed) carry it as actionId.

  • objectstringRequired

    One ofcall_action

  • statusstringRequired

    completed: done when this answered (send_dtmf, hold, resume, mute, unmute, record, hangup). started: under way on the call (speak, play, gather, transfer) — gather and transfer end in their own event.

    One ofcompletedstarted

Errors

Request
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": "#"
}'
Response 200 (json)
{
  "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/v1/calls/{callId}/events

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

  • limitinteger

    How many items to return.

  • cursorstring

    The nextCursor of the previous page. Omit for the first page.

Response 200PublicCallTimelinePage

  • dataPublicCallTimelineEvent[]Required

    7 fields of data
    • callIdstring (uuid)Required

    • dataPublicCallTimelineDataRequired

      24 fields of data
      • agentIdstring (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.

      • bystring

        recording.*: whose hand — api (a key’s record action) or desk (the agent on the call).

        One ofapidesk

      • chargePublicCallCharge

        rated: the call’s charge, as charge on the call.

        9 fields of charge
        • amountMinorintegerRequired

        • chargedMinutesintegerRequired

          Started minutes billed after the included minutes.

        • currencystringRequired

        • includedMinutesintegerRequired

          Included minutes this call used.

        • ratePerMinuteMinorintegerRequired

        • ratedAtstring (date-time)Required

        • reasonstring | nullRequired

          The 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) or waived; null when there is nothing to say. Plain English for people; switch on rule and status, never on this text.

        • rulestring | nullRequired

          The 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 and reason says both. v1 may add values: read one you do not know as an unexplained rule, by reason.

          One ofSTALL_SILENTSTALL_PAST_CEILINGAI_VOICE_NEVER_STARTEDTALK_TIME_UNKNOWN

        • statusstringRequired

          charged; 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 ofchargednot_connectedwaivedunrated

      • childCallIdstring (uuid) | null

        transfer.*, leg.*: the call that carries the other party’s leg (GET /v1/calls/{childCallId}), when there is one.

      • codestring | null

        The machine code why, when there is one — flow_step.ended (an AI step’s AI_PROVIDER_UNAVAILABLE, AI_AGENT_UNAVAILABLE, AI_CALLS_DISABLED, AI_PROVIDER_FAILED or BILLING_… 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 | null

        ended: why the call did not complete — the call’s own failure; null when it completed.

        2 fields of failure
        • codestringRequired

          Stable machine value: NO_ANSWER, BUSY, CANCELLED, or a failure code.

        • reasonstringRequired

          A plain-language reason.

      • fallbackboolean

        flow_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 (its onEscalate, or the next verb), a connect nobody answered (onNoAnswer), a timed-out gather.

      • flowIdstring (uuid)

        application.fallback: its fallbackFlowId, the call flow that ran instead of the apology.

      • maxDurationSecondsinteger | null

        ceiling.reached: the ceiling the call ran to (maxDurationSec), in seconds.

      • nextNodestring | null

        flow_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 | null

        flow_step.*, ai_step.*: the node of the stored flow it ran in; null for a step of an answer URL’s document.

      • outcomestring

        flow_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’s no_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 | null

        transcription.unavailable: how the speech-to-text was lost — unconfigured (none here), connect (it would not start), dropped (it stopped mid-call).

        One ofunconfiguredconnectdropped

      • queueIdstring (uuid) | null

        queue.*, and transfer.* to a queue: the queue.

      • recordingboolean

        recording.resumed: whether the call records again — another hand may still hold its pause (an agent’s pause outlasts a key’s resume).

      • rolestring

        leg.*: who joined or left — a desk agent, or a party dialled into the call (a transfer target, a conference party).

        One ofagentparty

      • statusstring

        ended: the call’s status once over.

        One ofqueuedinitiatingringingin_progressendingcompletedbusyno_answercancelledfailed

      • stepinteger

        flow_step.*, ai_step.*: the step’s count on this run of the flow, from 1.

      • targetstring

        transfer.*: who it goes to.

        One ofagentqueuenumber

      • tostring | null

        transfer.* to a number: the number, masked to its last four digits as to is on a call.

      • transferTypestring

        transfer.*: the kind of transfer.

        One ofblindwarm

      • verbstring

        flow_step.*: the verb (say, gather, ai, connect, …).

      • waitedSecondsinteger | null

        queue.left: seconds the caller waited.

    • idstring (uuid)Required

      The entry’s id (for rated, the charge’s).

    • objectstringRequired

      One ofcall_timeline_event

    • occurredAtstring (date-time)Required

    • sequenceinteger | nullRequired

      The entry’s place on the call’s timeline, rising; null for rated, which is always last.

    • typestringRequired

      What 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) and ai_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). And recording.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 ofcreatedqueuedringingansweredendedheldresumedflow_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 | nullRequired

    Pass back as cursor for the next page; null on the last.

Errors

Request
curl 'https://api.trovacast.com/v1/calls/CALL_ID/events' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/calls/{callId}/hangup

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-Keystring

    Makes 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 as Retry-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 after Retry-After seconds.
  • 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).
Request
curl -X POST 'https://api.trovacast.com/v1/calls/CALL_ID/hangup' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200 (json)
{
  "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/v1/calls/{callId}/recording

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 fields
  • callIdstring (uuid)Required

  • durationSecondsinteger | nullRequired

  • expiresAtstring (date-time)Required

    When url stops working (PUBLIC_API_RECORDING_URL_TTL_SECONDS, 15 minutes by default).

  • formatstring | nullRequired

  • idstring (uuid)Required

  • noticePlayedbooleanRequired

    A 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.

  • objectstringRequired

    One ofcall_recording

  • purposestringRequired

    What it is of: call — the call itself (the carrier’s or the stream’s copy, a call flow’s record, a connect that recorded its conversation) — or voicemail, a message the caller left.

    One ofcallvoicemail

  • statusstringRequired

    One ofavailable

  • urlstringRequired

    A 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

Request
curl 'https://api.trovacast.com/v1/calls/CALL_ID/recording' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/calls/{callId}/recording

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-Keystring

    Makes 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 after Retry-After); or CONFLICT.
  • 422IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.
  • 429RATE_LIMITED — retry after Retry-After seconds.
  • 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.
Request
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/v1/calls/{callId}/summary

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 fields
  • analyzedAtstring (date-time) | nullRequired

    When the AI graded the call.

  • callIdstring (uuid)Required

  • confidencenumber | nullRequired

    The AI’s confidence in its verdict.

    0–1

  • dispositionstring | nullRequired

    The AI’s verdict on how the call went.

    One ofinterestednot_interestedcallback_requestedsale_agreeddo_not_call_requestedwrong_numbervoicemailno_decision

  • extractionPublicCallExtraction | nullRequired

    What the call’s AI agent extracted with its extraction schema (/v1/agents extraction); null when its agent has none.

    5 fields of extraction
    • dataobject | nullRequired

      The data, matching the agent’s extraction schema; phone numbers in it masked to their last four digits. Null unless ready.

    • extractedAtstring (date-time) | nullRequired

    • failureCodestring | nullRequired

      PROVIDER_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 ofPROVIDER_FAILEDDECLINEDINVALID_OUTPUTUNREADABLE

    • mockbooleanRequired

      True 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.

    • statusstringRequired

      ready (data set), failed (failureCode says why), pending (not yet run — it runs with the summary), unavailable (never will: no transcript, or no reasoning provider).

      One ofreadyfailedpendingunavailable

  • followUpAtstring (date-time) | nullRequired

    A callback time the contact asked for (“tomorrow at 2”), resolved in the organization’s time zone.

  • mockbooleanRequired

    True 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.ready can be built against before going live. False on every live call.

  • objectstringRequired

    One ofcall_summary

  • outcomePublicCallOutcome | nullRequired

    The 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 outcome
    • codestring | null

      The organization’s own wrap-up code the agent filed (its slug), when it filed one — value is then the standard outcome the code counts as. Null for a standard outcome and for the AI’s verdict.

    • labelstring | null

      That code’s label as the agent picked it (a code renamed since still reads as filed). Null whenever code is.

    • sourcestringRequired

      agent when a person filed the wrap-up (it supersedes the AI’s verdict), else ai.

      One ofagentai

    • valuestringRequired

      One 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 (code names the code).

      One ofinterestednot_interestedcallback_requestedsale_agreeddo_not_call_requestedwrong_numbervoicemailno_decision

  • sentimentstring | nullRequired

    The contact’s mood over the call, as the AI read it.

    One ofpositiveneutralnegative

  • statusstringRequired

    pending while the call is live or still being finalized; ready once final; unavailable when 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 ofpendingreadyunavailable

  • summarystring | nullRequired

    The AI’s account of the conversation, phone numbers masked to their last four digits.

Errors

Request
curl 'https://api.trovacast.com/v1/calls/CALL_ID/summary' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/calls/{callId}/transcript

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

  • limitinteger

    How many items to return.

  • cursorstring

    The nextCursor of the previous page. Omit for the first page.

Response 200PublicCallTranscript

  • callIdstring (uuid)Required

  • dataPublicTranscriptSegment[]Required

    Oldest first. While the call is live this is what has been transcribed so far.

    11 fields of data
    • confidencenumber | nullRequired

      The transcriber’s confidence, when it reported one.

      0–1

    • createdAtstring (date-time)Required

    • endMsintegerRequired

      Milliseconds from when the call was created.

    • idstring (uuid)Required

    • languagestring | nullRequired

      The language the transcriber reported, when it did.

    • objectstringRequired

      One oftranscript_segment

    • revisionintegerRequired

      1 as transcribed; a correction would be a higher revision of the same sequence, listed after it.

    • sequenceintegerRequired

      The segment’s place in the call, from 1.

    • speakerstringRequired

      contact (the call’s contact), agent (a person on the desk), ai (the AI agent), supervisor, platform, or unknown — a turn the platform could not attribute (a carrier stream that mixes agent and contact).

      One ofcontactagentaisupervisorplatformunknown

    • startMsintegerRequired

      Milliseconds from when the call was created.

    • textstring | nullRequired

      What 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) | nullRequired

    When the platform declared the transcript complete (call.transcript.ready); null until then.

  • gapsPublicTranscriptGap[]Required

    When the call’s speech-to-text was down, oldest first; empty when it never was. Speech in a gap was not transcribed — a ready transcript 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 gaps
    • endedAtstring (date-time) | nullRequired

      When transcription came back; null while it is still down, or when it did not come back before the call ended.

    • phasestringRequired

      unconfigured (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 retried connect and dropped with backoff.

      One ofunconfiguredconnectdropped

    • startedAtstring (date-time)Required

  • nextCursorstring | nullRequired

    Pass back as cursor for the next page; null on the last.

  • objectstringRequired

    One ofcall_transcript

  • statusstringRequired

    pending while the call is live or still being finalized; ready once final; unavailable when 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 ofpendingreadyunavailable

  • unavailableReasonstring | nullRequired

    Why status is unavailable (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 (gaps says 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 ofdisabledtoo_shortprocessing_failedstt_unavailablenot_recorded

Errors

Request
curl 'https://api.trovacast.com/v1/calls/CALL_ID/transcript' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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
}