Jump to

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

API reference

AI agents

How these fit together: the AI voice agents guide.

List agents

get/v1/agents

Lists AI agents, newest first.

Every agent of the organization — organization-wide and team ones — newest first; archived agents only with includeArchived=true. Instructions are left out (read one agent for them) and no secret is listed, only toolSigningSecretLast4. livemode: false marks an agent a test key made, which runs test calls only.

Access: an organization key with the agents:read scope.

Query parameters

  • limitinteger

    How many items to return.

  • cursorstring

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

  • includeArchivedboolean

    Include archived agents.

Response 200PublicAgentPage

  • dataPublicAgent[]Required

    27 fields of data
    • activebooleanRequired

      Takes new calls.

    • archivedAtstring (date-time) | nullRequired

    • availabilityPublicAgentAvailabilityRequired

      Whether the agent can take a call on this deployment now, and why not. An agent that cannot is refused when it is saved (422 MODEL_UNAVAILABLE with the same reason); one saved before that check, or whose deployment lost a key since, reads runnable: false here.

      2 fields of availability
      • reasonstring | nullRequired

        Why not, when runnable is false: voice_key_missing (the voice provider has no key here), agent_id_missing (an ElevenLabs voice with no ElevenLabs agent id configured), transcription_key_missing (its speech-to-text has no key), reasoning_key_missing (a composite voice with no OpenAI or Anthropic key to write its replies). The same reason a call with the agent is refused with (422 AI_PROVIDER_UNAVAILABLE). Null when runnable.

        One ofvoice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missing

      • runnablebooleanRequired

        Whether a call with this agent would be admitted now: its voice provider has a key on this deployment, an ElevenLabs voice has an ElevenLabs agent id, and a composite voice has its transcription and reasoning keys — the check POST /v1/calls (mode: AI_AGENT) makes before anything is written. Read-only; it changes when the agent or the deployment does. A test agent on the mock voice is always runnable.

    • createdAtstring (date-time)Required

    • descriptionstring | nullRequired

    • endCallPhrasesstring[]Required

    • extractionPublicAgentExtraction | nullRequired

      2 fields of extraction
      • instructionsstring | nullRequired

      • schemaobjectRequired

    • firstMessagestring | nullRequired

    • firstSpeakerstringRequired

      Who speaks first on this agent’s calls — the one set, or its voice’s default.

      One ofagentcaller

    • idstring (uuid)Required

      What /v1/calls aiAgent.agentId takes.

    • isDefaultbooleanRequired

      The organization’s default agent of its kind.

    • kindstringRequired

      One ofautonomous_voicehybrid_voiceagent_assist

    • languagestring | nullRequired

    • livemodebooleanRequired

      false when a test key created it: it takes test calls only — never a live call, campaign, sequence or live flow — and cannot be the default. A live agent is read-only to a test key.

    • maxTurnsinteger | nullRequired

    • namestringRequired

    • objectstringRequired

      One ofagent

    • reasoningPublicAgentReasoning | nullRequired

      2 fields of reasoning
      • modelstringRequired

      • providerstringRequired

        One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock

    • teamIdstring | nullRequired

      The team the agent belongs to (agents made in the console can be a team’s); null for an organization-wide one.

    • toolSigningSecretstring

      The tool-signing secret, in the one response that minted it (the first tool given to the agent) — store it then. Rotate it with POST /v1/agents/:id/tool-secret.

    • toolSigningSecretLast4string | nullRequired

      The last four characters of the tool-signing secret; null until the agent has had a tool.

    • toolsPublicAgentTool[]Required

      4 fields of tools
      • descriptionstringRequired

      • namestringRequired

      • parametersobjectRequired

      • urlstringRequired

    • transcriptionPublicAgentTranscriptionRequired

      2 fields of transcription
      • modelstring | nullRequired

        One ofink-2ink-preview

      • providerstringRequired

        One ofautoelevenlabscartesia

    • updatedAtstring (date-time)Required

    • versionintegerRequired

    • voicePublicAgentVoiceRequired

      3 fields of voice
      • modelstringRequired

      • providerstringRequired

        One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock

      • voiceIdstring | nullRequired

    • warningsPublicAgentNumberWarning[]

      Only in the answer to PATCH /v1/agents/{agentId}: the organization’s numbers the change leaves failing, read after it — only warnings about the agent itself (AI_AGENT_UNAVAILABLE, AI_PROVIDER_UNAVAILABLE), never a price: each ai route to it (its calls are refused AI_AGENT_UNAVAILABLE) and each AI step naming it in a routed flow (the caller takes the step’s fallback), with the warning the number carries. Switching off an agent a number routes to is allowed — new calls, new AI steps and campaign dials stop using it at once, while a conversation already running finishes — and this lists what it stopped; [] when no number is affected (always for a test agent: a number takes live calls only).

      11 fields of warnings
      • agentIdstring (uuid) | nullRequired

        The AI agent the number’s route or step reaches; null for a key without numbers:read.

      • callTypestringRequired

        Always full_ai here: an AI route, or a flow’s AI step.

        One ofmanualfull_ai

      • codestringRequired

        As on the number’s own warnings, and here only ever about an AI agent: AI_AGENT_UNAVAILABLE (the agent cannot take the caller — reason AI_CALLS_DISABLED, AGENT_INACTIVE or TEST_AGENT) or AI_PROVIDER_UNAVAILABLE (its voice cannot run here — reason its availability.reason). One warning per cause, each with the same numberId (2026-11-07). Never BILLING_RATE_UNAVAILABLE.

        One ofBILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLE

      • detailbooleanRequired

        2026-11-07: whether the number’s details are in it. False for a key without numbers:read: only numberId, code and reason are told, the channel, agent, flow and step are null, and message names no route.

      • directionstringRequired

        One ofinbound

      • flowIdstring (uuid) | nullRequired

        2026-11-07: the routed flow (GET /v1/call-flows/{flowId}) whose AI step it is about; null for an ai route’s own warning, and for a key without numbers:read.

      • messagestringRequired

      • numberIdstring (uuid)Required

        The number (GET /v1/numbers/{numberId}), which carries this warning on every read until its cause goes.

      • providerstring | nullRequired

        The channel the number’s calls arrive on; null for a key without numbers:read.

        One ofairtelexotelplivosimtelnyxtwilio

      • reasonstring | nullRequired

        Why: AI_CALLS_DISABLED, AGENT_INACTIVE or TEST_AGENT for AI_AGENT_UNAVAILABLE; the agent’s availability.reason (lower case) for AI_PROVIDER_UNAVAILABLE.

        One ofvoice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENT

      • stepPublicNumberWarningStep | nullRequired

        The AI step of the routed flow it is about; null when it is about the route itself, and for a key without numbers:read.

        2 fields of step
        • indexintegerRequired

          Its position in the node, from 0: the step is nodes.<node>.<index> of the flow’s published version (the path POST /v1/call-flows/validate names its issues by).

          at least 0

        • nodestringRequired

          The node the step is in.

  • nextCursorstring | nullRequired

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

Errors

Request
curl 'https://api.trovacast.com/v1/agents' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "active": true,
      "archivedAt": "2026-11-05T10:00:00.000Z",
      "availability": {
        "reason": null,
        "runnable": true
      },
      "createdAt": "2026-11-05T10:00:00.000Z",
      "description": "DESCRIPTION",
      "endCallPhrases": [
        "END_CALL_PHRASES"
      ],
      "extraction": {
        "instructions": "INSTRUCTIONS",
        "schema": {}
      },
      "firstMessage": "FIRST_MESSAGE",
      "firstSpeaker": "agent",
      "id": "ID",
      "isDefault": true,
      "kind": "autonomous_voice",
      "language": "hi-IN",
      "livemode": true,
      "maxTurns": 1,
      "name": "NAME",
      "object": "agent",
      "reasoning": {
        "model": "MODEL",
        "provider": "openai"
      },
      "teamId": "TEAM_ID",
      "toolSigningSecret": "whsec_…",
      "toolSigningSecretLast4": "TOOL_SIGNING_SECRET_LAST4",
      "tools": [
        {
          "description": "DESCRIPTION",
          "name": "NAME",
          "parameters": {},
          "url": "URL"
        }
      ],
      "transcription": {
        "model": "ink-2",
        "provider": "auto"
      },
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "version": 1,
      "voice": {
        "model": "MODEL",
        "provider": "openai",
        "voiceId": "VOICE_ID"
      },
      "warnings": [
        {
          "agentId": "AGENT_ID",
          "callType": "manual",
          "code": "BILLING_RATE_UNAVAILABLE",
          "detail": true,
          "direction": "inbound",
          "flowId": "FLOW_ID",
          "message": "AI agent 0f9e… is switched off (AGENT_INACTIVE), so a caller who reaches the AI step at nodes.main.1 of this number's flow takes the step's fallback instead (AI_AGENT_UNAVAILABLE) until it is switched on (PATCH /v1/agents/0f9e… with active: true) or the step names another agent.",
          "numberId": "NUMBER_ID",
          "provider": "airtel",
          "reason": "voice_key_missing",
          "step": {
            "index": 1,
            "node": "main"
          }
        }
      ]
    }
  ],
  "nextCursor": "NEXT_CURSOR"
}

Create agent

post/v1/agents

Creates an AI agent.

Its instructions, voice and reasoning models, and what it does on a call: the first message (or waiting for the caller), the language, when it hangs up by itself (endCallPhrases, maxTurns), the tools it may call mid-call (your HTTPS endpoints, signed) and what to extract from each finished call. An agent given tools answers its tool-signing secret once, as toolSigningSecret.

Access: an organization key with the agents: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. 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

  • descriptionstring

    at most 1000 characters

  • endCallPhrasesstring[] | null

    The agent hangs up after it says one of these (case-insensitive, 2–120 characters each), once the line has played.

    at most 10 items

  • extractionPublicAgentExtractionInput | null

    Structured data to pull out of each finished call’s transcript — on GET /v1/calls/:id/summary and call.summary.ready as extraction.

    2 fields of extraction
    • instructionsstring | null

      Guidance for the extraction (units, formats, what counts).

      at most 2000 characters

    • schemaobjectRequired

      What to extract from the finished call’s transcript, as an object schema. A JSON Schema subset both reasoning providers can be held to: type (one of object, array, string, number, integer, boolean, null — or one of them with "null"), description, enum, format (date-time, date, time, duration, email, hostname, uri, uuid), properties, required, items, additionalProperties: false. Every object is closed. At most 5 levels, 100 schemas, 8 KB; anything else is refused (400) with the keyword named.

  • firstMessagestring | null

    Said word for word when the call connects (the agent speaks first). Not with firstSpeaker: caller.

    at most 1000 characters

  • firstSpeakerstring | null

    agent: the agent opens — with firstMessage, else with a line of its own. caller: it waits for the caller to speak. null: the voice’s default (a composite voice opens; a speech-to-speech voice waits).

    One ofagentcaller

  • instructionsstringRequired

    The agent’s instructions (system prompt / script). Stored encrypted.

    10–20000 characters

  • isDefaultboolean

    The organization’s default agent of its kind.

    default false

  • kindstring

    autonomous_voice runs a call on its own (/v1/calls AI_AGENT); hybrid_voice hands to a person; agent_assist coaches a person on the desk. Either case is accepted; lower case is canonical (what responses and GET /v1/models answer).

    One ofagent_assistautonomous_voicehybrid_voiceAGENT_ASSISTAUTONOMOUS_VOICEHYBRID_VOICE

    default "autonomous_voice"

  • languagestring | null

    A BCP 47 tag: what transcription listens for, what the voice speaks and the language the agent is told to reply in (it still follows a caller who switches). Stored canonical (hi-in reads hi-IN).

    at most 35 characters

  • maxTurnsinteger | null

    The agent hangs up after this many replies of its own (its closing line plays first).

    1–200

  • namestringRequired

    2–160 characters

  • reasoningPublicAgentReasoningInput

    2 fields of reasoning
    • modelstringRequired

      at most 160 characters

    • providerstring

      The voice provider when unset. Either case is accepted; lower case is canonical (what responses and GET /v1/models answer).

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockOPENAIANTHROPICELEVENLABSSARVAMCARTESIAAWS_NOVA_SONICMOCK

  • toolsPublicAgentToolInput[] | null

    Functions the agent may call mid-call (replaces the list; [] or null removes them). The first tool mints the agent’s tool-signing secret, answered once as toolSigningSecret. Used by the OpenAI realtime and composite voices; an ElevenLabs agent uses the tools configured at ElevenLabs.

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

    • parametersobjectRequired

      The arguments, as an object schema. A JSON Schema subset both reasoning providers can be held to: type (one of object, array, string, number, integer, boolean, null — or one of them with "null"), description, enum, format (date-time, date, time, duration, email, hostname, uri, uuid), properties, required, items, additionalProperties: false. Every object is closed. At most 5 levels, 100 schemas, 8 KB; anything else is refused (400) with the keyword named.

    • urlstringRequired

      Your HTTPS endpoint. Each call POSTs { event: "agent.tool_call", requestId, agentId, callId, toolCallId, tool, arguments, call, timestamp } — call (2026-11-21) says which call it is about: { direction, from, to, contactId, numberId, metadata, numberMetadata, reference }, the contact masked to their last four digits (•••• ••3210) whichever end they are and your number in full — signed with the agent’s tool-signing secret (Trovacast-Signature, the webhook scheme). Answer 2xx JSON within 4 seconds (at most 16 KB): { "result": … } is what the agent is told; anything else, a timeout or a non-2xx tells it the tool failed. The URL rules of webhook endpoints apply (https, a public address, an allowed port).

      at most 2048 characters

  • transcriptionPublicAgentTranscriptionInput

    2 fields of transcription
    • modelstring

      Either case is accepted; lower case is canonical (what responses and GET /v1/models answer).

      One ofink-2ink-previewINK-2INK-PREVIEW

    • providerstringRequired

      auto lets the platform choose. Either case is accepted; lower case is canonical (what responses and GET /v1/models answer).

      One ofautoelevenlabscartesiaAUTOELEVENLABSCARTESIA

  • voicePublicAgentVoiceInputRequired

    3 fields of voice
    • modelstringRequired

      A model the provider serves for the voice leg (GET /v1/models); an unknown id is refused here, never mid-call.

      at most 160 characters

    • providerstringRequired

      Who runs the voice (media) leg. Either case is accepted; lower case is canonical (what responses and GET /v1/models answer). mock (with mock-voice / mock-reasoning) is the test-mode voice and model: a test key’s agent only, no provider key needed (a live key is refused 422 MODEL_UNAVAILABLE).

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockOPENAIANTHROPICELEVENLABSSARVAMCARTESIAAWS_NOVA_SONICMOCK

    • voiceIdstring

      The provider’s voice id; its default when unset.

      at most 255 characters

Response 201PublicAgent

Show the 27 fields
  • activebooleanRequired

    Takes new calls.

  • archivedAtstring (date-time) | nullRequired

  • availabilityPublicAgentAvailabilityRequired

    Whether the agent can take a call on this deployment now, and why not. An agent that cannot is refused when it is saved (422 MODEL_UNAVAILABLE with the same reason); one saved before that check, or whose deployment lost a key since, reads runnable: false here.

    2 fields of availability
    • reasonstring | nullRequired

      Why not, when runnable is false: voice_key_missing (the voice provider has no key here), agent_id_missing (an ElevenLabs voice with no ElevenLabs agent id configured), transcription_key_missing (its speech-to-text has no key), reasoning_key_missing (a composite voice with no OpenAI or Anthropic key to write its replies). The same reason a call with the agent is refused with (422 AI_PROVIDER_UNAVAILABLE). Null when runnable.

      One ofvoice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missing

    • runnablebooleanRequired

      Whether a call with this agent would be admitted now: its voice provider has a key on this deployment, an ElevenLabs voice has an ElevenLabs agent id, and a composite voice has its transcription and reasoning keys — the check POST /v1/calls (mode: AI_AGENT) makes before anything is written. Read-only; it changes when the agent or the deployment does. A test agent on the mock voice is always runnable.

  • createdAtstring (date-time)Required

  • descriptionstring | nullRequired

  • endCallPhrasesstring[]Required

  • extractionPublicAgentExtraction | nullRequired

    2 fields of extraction
    • instructionsstring | nullRequired

    • schemaobjectRequired

  • firstMessagestring | nullRequired

  • firstSpeakerstringRequired

    Who speaks first on this agent’s calls — the one set, or its voice’s default.

    One ofagentcaller

  • idstring (uuid)Required

    What /v1/calls aiAgent.agentId takes.

  • isDefaultbooleanRequired

    The organization’s default agent of its kind.

  • kindstringRequired

    One ofautonomous_voicehybrid_voiceagent_assist

  • languagestring | nullRequired

  • livemodebooleanRequired

    false when a test key created it: it takes test calls only — never a live call, campaign, sequence or live flow — and cannot be the default. A live agent is read-only to a test key.

  • maxTurnsinteger | nullRequired

  • namestringRequired

  • objectstringRequired

    One ofagent

  • reasoningPublicAgentReasoning | nullRequired

    2 fields of reasoning
    • modelstringRequired

    • providerstringRequired

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock

  • teamIdstring | nullRequired

    The team the agent belongs to (agents made in the console can be a team’s); null for an organization-wide one.

  • toolSigningSecretstring

    The tool-signing secret, in the one response that minted it (the first tool given to the agent) — store it then. Rotate it with POST /v1/agents/:id/tool-secret.

  • toolSigningSecretLast4string | nullRequired

    The last four characters of the tool-signing secret; null until the agent has had a tool.

  • toolsPublicAgentTool[]Required

    4 fields of tools
    • descriptionstringRequired

    • namestringRequired

    • parametersobjectRequired

    • urlstringRequired

  • transcriptionPublicAgentTranscriptionRequired

    2 fields of transcription
    • modelstring | nullRequired

      One ofink-2ink-preview

    • providerstringRequired

      One ofautoelevenlabscartesia

  • updatedAtstring (date-time)Required

  • versionintegerRequired

  • voicePublicAgentVoiceRequired

    3 fields of voice
    • modelstringRequired

    • providerstringRequired

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock

    • voiceIdstring | nullRequired

  • warningsPublicAgentNumberWarning[]

    Only in the answer to PATCH /v1/agents/{agentId}: the organization’s numbers the change leaves failing, read after it — only warnings about the agent itself (AI_AGENT_UNAVAILABLE, AI_PROVIDER_UNAVAILABLE), never a price: each ai route to it (its calls are refused AI_AGENT_UNAVAILABLE) and each AI step naming it in a routed flow (the caller takes the step’s fallback), with the warning the number carries. Switching off an agent a number routes to is allowed — new calls, new AI steps and campaign dials stop using it at once, while a conversation already running finishes — and this lists what it stopped; [] when no number is affected (always for a test agent: a number takes live calls only).

    11 fields of warnings
    • agentIdstring (uuid) | nullRequired

      The AI agent the number’s route or step reaches; null for a key without numbers:read.

    • callTypestringRequired

      Always full_ai here: an AI route, or a flow’s AI step.

      One ofmanualfull_ai

    • codestringRequired

      As on the number’s own warnings, and here only ever about an AI agent: AI_AGENT_UNAVAILABLE (the agent cannot take the caller — reason AI_CALLS_DISABLED, AGENT_INACTIVE or TEST_AGENT) or AI_PROVIDER_UNAVAILABLE (its voice cannot run here — reason its availability.reason). One warning per cause, each with the same numberId (2026-11-07). Never BILLING_RATE_UNAVAILABLE.

      One ofBILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLE

    • detailbooleanRequired

      2026-11-07: whether the number’s details are in it. False for a key without numbers:read: only numberId, code and reason are told, the channel, agent, flow and step are null, and message names no route.

    • directionstringRequired

      One ofinbound

    • flowIdstring (uuid) | nullRequired

      2026-11-07: the routed flow (GET /v1/call-flows/{flowId}) whose AI step it is about; null for an ai route’s own warning, and for a key without numbers:read.

    • messagestringRequired

    • numberIdstring (uuid)Required

      The number (GET /v1/numbers/{numberId}), which carries this warning on every read until its cause goes.

    • providerstring | nullRequired

      The channel the number’s calls arrive on; null for a key without numbers:read.

      One ofairtelexotelplivosimtelnyxtwilio

    • reasonstring | nullRequired

      Why: AI_CALLS_DISABLED, AGENT_INACTIVE or TEST_AGENT for AI_AGENT_UNAVAILABLE; the agent’s availability.reason (lower case) for AI_PROVIDER_UNAVAILABLE.

      One ofvoice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENT

    • stepPublicNumberWarningStep | nullRequired

      The AI step of the routed flow it is about; null when it is about the route itself, and for a key without numbers:read.

      2 fields of step
      • indexintegerRequired

        Its position in the node, from 0: the step is nodes.<node>.<index> of the flow’s published version (the path POST /v1/call-flows/validate names its issues by).

        at least 0

      • nodestringRequired

        The node the step is in.

Errors

  • 400VALIDATION_FAILED — a model the provider does not serve for that leg (see GET /v1/models), a voice that model cannot use, a default that is not organization-wide; or a firstMessage with firstSpeaker: caller, a language that is not a BCP 47 tag, a tool or extraction schema outside the supported subset (the keyword is named), a tool URL the platform will not call, or behavior on an agent_assist agent.
  • 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.
  • 409AI_AGENT_NAME_TAKEN — another agent has that name; or IDEMPOTENCY_KEY_IN_FLIGHT.
  • 422TEST_MODE_UNSUPPORTED — a TEST key changing a live agent (it may change only test agents), or making one the default; MODEL_UNAVAILABLE — a leg names a provider this deployment cannot run (provider, leg, model; GET /v1/models marks each model available); or IDEMPOTENCY_KEY_REUSED.
  • 429RATE_LIMITED — retry after Retry-After seconds.
  • 500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
Request
curl -X POST 'https://api.trovacast.com/v1/agents' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Delivery confirmations",
  "kind": "AUTONOMOUS_VOICE",
  "voice": {
    "provider": "OPENAI",
    "model": "gpt-realtime"
  },
  "instructions": "Confirm the delivery slot politely, offer to reschedule, then end the call."
}'
Response 201 (json)
{
  "active": true,
  "archivedAt": "2026-11-05T10:00:00.000Z",
  "availability": {
    "reason": null,
    "runnable": true
  },
  "createdAt": "2026-11-05T10:00:00.000Z",
  "description": "DESCRIPTION",
  "endCallPhrases": [
    "END_CALL_PHRASES"
  ],
  "extraction": {
    "instructions": "INSTRUCTIONS",
    "schema": {}
  },
  "firstMessage": "FIRST_MESSAGE",
  "firstSpeaker": "agent",
  "id": "ID",
  "isDefault": true,
  "kind": "autonomous_voice",
  "language": "hi-IN",
  "livemode": true,
  "maxTurns": 1,
  "name": "NAME",
  "object": "agent",
  "reasoning": {
    "model": "MODEL",
    "provider": "openai"
  },
  "teamId": "TEAM_ID",
  "toolSigningSecret": "whsec_…",
  "toolSigningSecretLast4": "TOOL_SIGNING_SECRET_LAST4",
  "tools": [
    {
      "description": "DESCRIPTION",
      "name": "NAME",
      "parameters": {},
      "url": "URL"
    }
  ],
  "transcription": {
    "model": "ink-2",
    "provider": "auto"
  },
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1,
  "voice": {
    "model": "MODEL",
    "provider": "openai",
    "voiceId": "VOICE_ID"
  },
  "warnings": [
    {
      "agentId": "AGENT_ID",
      "callType": "manual",
      "code": "BILLING_RATE_UNAVAILABLE",
      "detail": true,
      "direction": "inbound",
      "flowId": "FLOW_ID",
      "message": "AI agent 0f9e… is switched off (AGENT_INACTIVE), so a caller who reaches the AI step at nodes.main.1 of this number's flow takes the step's fallback instead (AI_AGENT_UNAVAILABLE) until it is switched on (PATCH /v1/agents/0f9e… with active: true) or the step names another agent.",
      "numberId": "NUMBER_ID",
      "provider": "airtel",
      "reason": "voice_key_missing",
      "step": {
        "index": 1,
        "node": "main"
      }
    }
  ]
}

Get agent

get/v1/agents/{agentId}

Retrieves an AI agent, with its instructions.

The agent as listed, plus its instructions; an archived agent reads too. Its tool-signing secret is never returned again (toolSigningSecretLast4 only — rotate it for a new one), and a provider credential never at all.

Access: an organization key with the agents:read scope.

Path parameters

  • agentIdstringRequired

Response 200PublicAgentWithInstructions

Show the 28 fields
  • activebooleanRequired

    Takes new calls.

  • archivedAtstring (date-time) | nullRequired

  • availabilityPublicAgentAvailabilityRequired

    Whether the agent can take a call on this deployment now, and why not. An agent that cannot is refused when it is saved (422 MODEL_UNAVAILABLE with the same reason); one saved before that check, or whose deployment lost a key since, reads runnable: false here.

    2 fields of availability
    • reasonstring | nullRequired

      Why not, when runnable is false: voice_key_missing (the voice provider has no key here), agent_id_missing (an ElevenLabs voice with no ElevenLabs agent id configured), transcription_key_missing (its speech-to-text has no key), reasoning_key_missing (a composite voice with no OpenAI or Anthropic key to write its replies). The same reason a call with the agent is refused with (422 AI_PROVIDER_UNAVAILABLE). Null when runnable.

      One ofvoice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missing

    • runnablebooleanRequired

      Whether a call with this agent would be admitted now: its voice provider has a key on this deployment, an ElevenLabs voice has an ElevenLabs agent id, and a composite voice has its transcription and reasoning keys — the check POST /v1/calls (mode: AI_AGENT) makes before anything is written. Read-only; it changes when the agent or the deployment does. A test agent on the mock voice is always runnable.

  • createdAtstring (date-time)Required

  • descriptionstring | nullRequired

  • endCallPhrasesstring[]Required

  • extractionPublicAgentExtraction | nullRequired

    2 fields of extraction
    • instructionsstring | nullRequired

    • schemaobjectRequired

  • firstMessagestring | nullRequired

  • firstSpeakerstringRequired

    Who speaks first on this agent’s calls — the one set, or its voice’s default.

    One ofagentcaller

  • idstring (uuid)Required

    What /v1/calls aiAgent.agentId takes.

  • instructionsstring | nullRequired

    The instructions, on a single-agent read only; null when they cannot be decrypted (a lost key — rewrite them).

  • isDefaultbooleanRequired

    The organization’s default agent of its kind.

  • kindstringRequired

    One ofautonomous_voicehybrid_voiceagent_assist

  • languagestring | nullRequired

  • livemodebooleanRequired

    false when a test key created it: it takes test calls only — never a live call, campaign, sequence or live flow — and cannot be the default. A live agent is read-only to a test key.

  • maxTurnsinteger | nullRequired

  • namestringRequired

  • objectstringRequired

    One ofagent

  • reasoningPublicAgentReasoning | nullRequired

    2 fields of reasoning
    • modelstringRequired

    • providerstringRequired

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock

  • teamIdstring | nullRequired

    The team the agent belongs to (agents made in the console can be a team’s); null for an organization-wide one.

  • toolSigningSecretstring

    The tool-signing secret, in the one response that minted it (the first tool given to the agent) — store it then. Rotate it with POST /v1/agents/:id/tool-secret.

  • toolSigningSecretLast4string | nullRequired

    The last four characters of the tool-signing secret; null until the agent has had a tool.

  • toolsPublicAgentTool[]Required

    4 fields of tools
    • descriptionstringRequired

    • namestringRequired

    • parametersobjectRequired

    • urlstringRequired

  • transcriptionPublicAgentTranscriptionRequired

    2 fields of transcription
    • modelstring | nullRequired

      One ofink-2ink-preview

    • providerstringRequired

      One ofautoelevenlabscartesia

  • updatedAtstring (date-time)Required

  • versionintegerRequired

  • voicePublicAgentVoiceRequired

    3 fields of voice
    • modelstringRequired

    • providerstringRequired

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock

    • voiceIdstring | nullRequired

  • warningsPublicAgentNumberWarning[]

    Only in the answer to PATCH /v1/agents/{agentId}: the organization’s numbers the change leaves failing, read after it — only warnings about the agent itself (AI_AGENT_UNAVAILABLE, AI_PROVIDER_UNAVAILABLE), never a price: each ai route to it (its calls are refused AI_AGENT_UNAVAILABLE) and each AI step naming it in a routed flow (the caller takes the step’s fallback), with the warning the number carries. Switching off an agent a number routes to is allowed — new calls, new AI steps and campaign dials stop using it at once, while a conversation already running finishes — and this lists what it stopped; [] when no number is affected (always for a test agent: a number takes live calls only).

    11 fields of warnings
    • agentIdstring (uuid) | nullRequired

      The AI agent the number’s route or step reaches; null for a key without numbers:read.

    • callTypestringRequired

      Always full_ai here: an AI route, or a flow’s AI step.

      One ofmanualfull_ai

    • codestringRequired

      As on the number’s own warnings, and here only ever about an AI agent: AI_AGENT_UNAVAILABLE (the agent cannot take the caller — reason AI_CALLS_DISABLED, AGENT_INACTIVE or TEST_AGENT) or AI_PROVIDER_UNAVAILABLE (its voice cannot run here — reason its availability.reason). One warning per cause, each with the same numberId (2026-11-07). Never BILLING_RATE_UNAVAILABLE.

      One ofBILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLE

    • detailbooleanRequired

      2026-11-07: whether the number’s details are in it. False for a key without numbers:read: only numberId, code and reason are told, the channel, agent, flow and step are null, and message names no route.

    • directionstringRequired

      One ofinbound

    • flowIdstring (uuid) | nullRequired

      2026-11-07: the routed flow (GET /v1/call-flows/{flowId}) whose AI step it is about; null for an ai route’s own warning, and for a key without numbers:read.

    • messagestringRequired

    • numberIdstring (uuid)Required

      The number (GET /v1/numbers/{numberId}), which carries this warning on every read until its cause goes.

    • providerstring | nullRequired

      The channel the number’s calls arrive on; null for a key without numbers:read.

      One ofairtelexotelplivosimtelnyxtwilio

    • reasonstring | nullRequired

      Why: AI_CALLS_DISABLED, AGENT_INACTIVE or TEST_AGENT for AI_AGENT_UNAVAILABLE; the agent’s availability.reason (lower case) for AI_PROVIDER_UNAVAILABLE.

      One ofvoice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENT

    • stepPublicNumberWarningStep | nullRequired

      The AI step of the routed flow it is about; null when it is about the route itself, and for a key without numbers:read.

      2 fields of step
      • indexintegerRequired

        Its position in the node, from 0: the step is nodes.<node>.<index> of the flow’s published version (the path POST /v1/call-flows/validate names its issues by).

        at least 0

      • nodestringRequired

        The node the step is in.

Errors

Request
curl 'https://api.trovacast.com/v1/agents/AGENT_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "active": true,
  "archivedAt": "2026-11-05T10:00:00.000Z",
  "availability": {
    "reason": null,
    "runnable": true
  },
  "createdAt": "2026-11-05T10:00:00.000Z",
  "description": "DESCRIPTION",
  "endCallPhrases": [
    "END_CALL_PHRASES"
  ],
  "extraction": {
    "instructions": "INSTRUCTIONS",
    "schema": {}
  },
  "firstMessage": "FIRST_MESSAGE",
  "firstSpeaker": "agent",
  "id": "ID",
  "instructions": "INSTRUCTIONS",
  "isDefault": true,
  "kind": "autonomous_voice",
  "language": "hi-IN",
  "livemode": true,
  "maxTurns": 1,
  "name": "NAME",
  "object": "agent",
  "reasoning": {
    "model": "MODEL",
    "provider": "openai"
  },
  "teamId": "TEAM_ID",
  "toolSigningSecret": "whsec_…",
  "toolSigningSecretLast4": "TOOL_SIGNING_SECRET_LAST4",
  "tools": [
    {
      "description": "DESCRIPTION",
      "name": "NAME",
      "parameters": {},
      "url": "URL"
    }
  ],
  "transcription": {
    "model": "ink-2",
    "provider": "auto"
  },
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1,
  "voice": {
    "model": "MODEL",
    "provider": "openai",
    "voiceId": "VOICE_ID"
  },
  "warnings": [
    {
      "agentId": "AGENT_ID",
      "callType": "manual",
      "code": "BILLING_RATE_UNAVAILABLE",
      "detail": true,
      "direction": "inbound",
      "flowId": "FLOW_ID",
      "message": "AI agent 0f9e… is switched off (AGENT_INACTIVE), so a caller who reaches the AI step at nodes.main.1 of this number's flow takes the step's fallback instead (AI_AGENT_UNAVAILABLE) until it is switched on (PATCH /v1/agents/0f9e… with active: true) or the step names another agent.",
      "numberId": "NUMBER_ID",
      "provider": "airtel",
      "reason": "voice_key_missing",
      "step": {
        "index": 1,
        "node": "main"
      }
    }
  ]
}

Update agent

patch/v1/agents/{agentId}

Changes an AI agent.

Only the fields sent change; null clears a behavior field (tools: [] or null removes the tools). Send the version you read for a compare-and-set (409 AI_AGENT_VERSION_CONFLICT when it moved; omitted, last write wins); a name another agent has is 409 AI_AGENT_NAME_TAKEN, and an archived agent cannot be changed or switched back on (400; route the numbers and flow steps that name it to another agent instead). The first tools given to an agent without a signing secret mint one, answered once as toolSigningSecret; isDefault: true takes the default from the agent that had it. A test key may change only test agents (livemode: false) and never make one the default (422 TEST_MODE_UNSUPPORTED). Switching off (active: false) an agent a number routes to is allowed — new calls, new AI steps, a carrier’s re-attach of a running call and campaign dials stop using it at once, while a conversation it is already having finishes (hang that call up with POST /v1/calls/{callId}/hangup to stop it now) — and the answer’s warnings lists every number the change leaves failing: an ai route to the agent (its calls are now refused AI_AGENT_UNAVAILABLE) or an AI step naming it in a routed flow (the caller takes the step’s fallback), each with the warning the number itself carries on every read until its cause goes, and (2026-11-07) flowId, the routed flow a step warning is about. Without numbers:read a warning carries only numberId, code and reason (detail: false): the number’s channel, agent, flow and step are numbers:read’s to read.

Access: an organization key with the agents:write scope.

Path parameters

  • agentIdstringRequired

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

  • activeboolean

    Switch the agent off (or on) without archiving it.

  • descriptionstring

    at most 1000 characters

  • endCallPhrasesstring[] | null

    The agent hangs up after it says one of these (case-insensitive, 2–120 characters each), once the line has played.

    at most 10 items

  • extractionPublicAgentExtractionInput | null

    Structured data to pull out of each finished call’s transcript — on GET /v1/calls/:id/summary and call.summary.ready as extraction.

    2 fields of extraction
    • instructionsstring | null

      Guidance for the extraction (units, formats, what counts).

      at most 2000 characters

    • schemaobjectRequired

      What to extract from the finished call’s transcript, as an object schema. A JSON Schema subset both reasoning providers can be held to: type (one of object, array, string, number, integer, boolean, null — or one of them with "null"), description, enum, format (date-time, date, time, duration, email, hostname, uri, uuid), properties, required, items, additionalProperties: false. Every object is closed. At most 5 levels, 100 schemas, 8 KB; anything else is refused (400) with the keyword named.

  • firstMessagestring | null

    Said word for word when the call connects (the agent speaks first). Not with firstSpeaker: caller.

    at most 1000 characters

  • firstSpeakerstring | null

    agent: the agent opens — with firstMessage, else with a line of its own. caller: it waits for the caller to speak. null: the voice’s default (a composite voice opens; a speech-to-speech voice waits).

    One ofagentcaller

  • instructionsstring

    10–20000 characters

  • isDefaultboolean

  • languagestring | null

    A BCP 47 tag: what transcription listens for, what the voice speaks and the language the agent is told to reply in (it still follows a caller who switches). Stored canonical (hi-in reads hi-IN).

    at most 35 characters

  • maxTurnsinteger | null

    The agent hangs up after this many replies of its own (its closing line plays first).

    1–200

  • namestring

    2–160 characters

  • reasoningPublicAgentReasoningInput

    2 fields of reasoning
    • modelstringRequired

      at most 160 characters

    • providerstring

      The voice provider when unset. Either case is accepted; lower case is canonical (what responses and GET /v1/models answer).

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockOPENAIANTHROPICELEVENLABSSARVAMCARTESIAAWS_NOVA_SONICMOCK

  • toolsPublicAgentToolInput[] | null

    Functions the agent may call mid-call (replaces the list; [] or null removes them). The first tool mints the agent’s tool-signing secret, answered once as toolSigningSecret. Used by the OpenAI realtime and composite voices; an ElevenLabs agent uses the tools configured at ElevenLabs.

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

    • parametersobjectRequired

      The arguments, as an object schema. A JSON Schema subset both reasoning providers can be held to: type (one of object, array, string, number, integer, boolean, null — or one of them with "null"), description, enum, format (date-time, date, time, duration, email, hostname, uri, uuid), properties, required, items, additionalProperties: false. Every object is closed. At most 5 levels, 100 schemas, 8 KB; anything else is refused (400) with the keyword named.

    • urlstringRequired

      Your HTTPS endpoint. Each call POSTs { event: "agent.tool_call", requestId, agentId, callId, toolCallId, tool, arguments, call, timestamp } — call (2026-11-21) says which call it is about: { direction, from, to, contactId, numberId, metadata, numberMetadata, reference }, the contact masked to their last four digits (•••• ••3210) whichever end they are and your number in full — signed with the agent’s tool-signing secret (Trovacast-Signature, the webhook scheme). Answer 2xx JSON within 4 seconds (at most 16 KB): { "result": … } is what the agent is told; anything else, a timeout or a non-2xx tells it the tool failed. The URL rules of webhook endpoints apply (https, a public address, an allowed port).

      at most 2048 characters

  • transcriptionPublicAgentTranscriptionInput

    2 fields of transcription
    • modelstring

      Either case is accepted; lower case is canonical (what responses and GET /v1/models answer).

      One ofink-2ink-previewINK-2INK-PREVIEW

    • providerstringRequired

      auto lets the platform choose. Either case is accepted; lower case is canonical (what responses and GET /v1/models answer).

      One ofautoelevenlabscartesiaAUTOELEVENLABSCARTESIA

  • versioninteger

    The version you read (409 when it moved). Omitted: last write wins.

  • voicePublicAgentVoiceInput

    3 fields of voice
    • modelstringRequired

      A model the provider serves for the voice leg (GET /v1/models); an unknown id is refused here, never mid-call.

      at most 160 characters

    • providerstringRequired

      Who runs the voice (media) leg. Either case is accepted; lower case is canonical (what responses and GET /v1/models answer). mock (with mock-voice / mock-reasoning) is the test-mode voice and model: a test key’s agent only, no provider key needed (a live key is refused 422 MODEL_UNAVAILABLE).

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockOPENAIANTHROPICELEVENLABSSARVAMCARTESIAAWS_NOVA_SONICMOCK

    • voiceIdstring

      The provider’s voice id; its default when unset.

      at most 255 characters

Response 200PublicAgent

Show the 27 fields
  • activebooleanRequired

    Takes new calls.

  • archivedAtstring (date-time) | nullRequired

  • availabilityPublicAgentAvailabilityRequired

    Whether the agent can take a call on this deployment now, and why not. An agent that cannot is refused when it is saved (422 MODEL_UNAVAILABLE with the same reason); one saved before that check, or whose deployment lost a key since, reads runnable: false here.

    2 fields of availability
    • reasonstring | nullRequired

      Why not, when runnable is false: voice_key_missing (the voice provider has no key here), agent_id_missing (an ElevenLabs voice with no ElevenLabs agent id configured), transcription_key_missing (its speech-to-text has no key), reasoning_key_missing (a composite voice with no OpenAI or Anthropic key to write its replies). The same reason a call with the agent is refused with (422 AI_PROVIDER_UNAVAILABLE). Null when runnable.

      One ofvoice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missing

    • runnablebooleanRequired

      Whether a call with this agent would be admitted now: its voice provider has a key on this deployment, an ElevenLabs voice has an ElevenLabs agent id, and a composite voice has its transcription and reasoning keys — the check POST /v1/calls (mode: AI_AGENT) makes before anything is written. Read-only; it changes when the agent or the deployment does. A test agent on the mock voice is always runnable.

  • createdAtstring (date-time)Required

  • descriptionstring | nullRequired

  • endCallPhrasesstring[]Required

  • extractionPublicAgentExtraction | nullRequired

    2 fields of extraction
    • instructionsstring | nullRequired

    • schemaobjectRequired

  • firstMessagestring | nullRequired

  • firstSpeakerstringRequired

    Who speaks first on this agent’s calls — the one set, or its voice’s default.

    One ofagentcaller

  • idstring (uuid)Required

    What /v1/calls aiAgent.agentId takes.

  • isDefaultbooleanRequired

    The organization’s default agent of its kind.

  • kindstringRequired

    One ofautonomous_voicehybrid_voiceagent_assist

  • languagestring | nullRequired

  • livemodebooleanRequired

    false when a test key created it: it takes test calls only — never a live call, campaign, sequence or live flow — and cannot be the default. A live agent is read-only to a test key.

  • maxTurnsinteger | nullRequired

  • namestringRequired

  • objectstringRequired

    One ofagent

  • reasoningPublicAgentReasoning | nullRequired

    2 fields of reasoning
    • modelstringRequired

    • providerstringRequired

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock

  • teamIdstring | nullRequired

    The team the agent belongs to (agents made in the console can be a team’s); null for an organization-wide one.

  • toolSigningSecretstring

    The tool-signing secret, in the one response that minted it (the first tool given to the agent) — store it then. Rotate it with POST /v1/agents/:id/tool-secret.

  • toolSigningSecretLast4string | nullRequired

    The last four characters of the tool-signing secret; null until the agent has had a tool.

  • toolsPublicAgentTool[]Required

    4 fields of tools
    • descriptionstringRequired

    • namestringRequired

    • parametersobjectRequired

    • urlstringRequired

  • transcriptionPublicAgentTranscriptionRequired

    2 fields of transcription
    • modelstring | nullRequired

      One ofink-2ink-preview

    • providerstringRequired

      One ofautoelevenlabscartesia

  • updatedAtstring (date-time)Required

  • versionintegerRequired

  • voicePublicAgentVoiceRequired

    3 fields of voice
    • modelstringRequired

    • providerstringRequired

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock

    • voiceIdstring | nullRequired

  • warningsPublicAgentNumberWarning[]

    Only in the answer to PATCH /v1/agents/{agentId}: the organization’s numbers the change leaves failing, read after it — only warnings about the agent itself (AI_AGENT_UNAVAILABLE, AI_PROVIDER_UNAVAILABLE), never a price: each ai route to it (its calls are refused AI_AGENT_UNAVAILABLE) and each AI step naming it in a routed flow (the caller takes the step’s fallback), with the warning the number carries. Switching off an agent a number routes to is allowed — new calls, new AI steps and campaign dials stop using it at once, while a conversation already running finishes — and this lists what it stopped; [] when no number is affected (always for a test agent: a number takes live calls only).

    11 fields of warnings
    • agentIdstring (uuid) | nullRequired

      The AI agent the number’s route or step reaches; null for a key without numbers:read.

    • callTypestringRequired

      Always full_ai here: an AI route, or a flow’s AI step.

      One ofmanualfull_ai

    • codestringRequired

      As on the number’s own warnings, and here only ever about an AI agent: AI_AGENT_UNAVAILABLE (the agent cannot take the caller — reason AI_CALLS_DISABLED, AGENT_INACTIVE or TEST_AGENT) or AI_PROVIDER_UNAVAILABLE (its voice cannot run here — reason its availability.reason). One warning per cause, each with the same numberId (2026-11-07). Never BILLING_RATE_UNAVAILABLE.

      One ofBILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLE

    • detailbooleanRequired

      2026-11-07: whether the number’s details are in it. False for a key without numbers:read: only numberId, code and reason are told, the channel, agent, flow and step are null, and message names no route.

    • directionstringRequired

      One ofinbound

    • flowIdstring (uuid) | nullRequired

      2026-11-07: the routed flow (GET /v1/call-flows/{flowId}) whose AI step it is about; null for an ai route’s own warning, and for a key without numbers:read.

    • messagestringRequired

    • numberIdstring (uuid)Required

      The number (GET /v1/numbers/{numberId}), which carries this warning on every read until its cause goes.

    • providerstring | nullRequired

      The channel the number’s calls arrive on; null for a key without numbers:read.

      One ofairtelexotelplivosimtelnyxtwilio

    • reasonstring | nullRequired

      Why: AI_CALLS_DISABLED, AGENT_INACTIVE or TEST_AGENT for AI_AGENT_UNAVAILABLE; the agent’s availability.reason (lower case) for AI_PROVIDER_UNAVAILABLE.

      One ofvoice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENT

    • stepPublicNumberWarningStep | nullRequired

      The AI step of the routed flow it is about; null when it is about the route itself, and for a key without numbers:read.

      2 fields of step
      • indexintegerRequired

        Its position in the node, from 0: the step is nodes.<node>.<index> of the flow’s published version (the path POST /v1/call-flows/validate names its issues by).

        at least 0

      • nodestringRequired

        The node the step is in.

Errors

  • 400VALIDATION_FAILED — a model the provider does not serve for that leg (see GET /v1/models), a voice that model cannot use, a default that is not organization-wide; or a firstMessage with firstSpeaker: caller, a language that is not a BCP 47 tag, a tool or extraction schema outside the supported subset (the keyword is named), a tool URL the platform will not call, or behavior on an agent_assist agent. Or an archived agent.
  • 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 agent.
  • 409AI_AGENT_VERSION_CONFLICT — the agent changed since the version sent (read it again); AI_AGENT_NAME_TAKEN — another agent has the name; or IDEMPOTENCY_KEY_IN_FLIGHT.
  • 422TEST_MODE_UNSUPPORTED — a TEST key changing a live agent (it may change only test agents), or making one the default; MODEL_UNAVAILABLE — a leg names a provider this deployment cannot run (provider, leg, model; GET /v1/models marks each model available); or IDEMPOTENCY_KEY_REUSED.
  • 429RATE_LIMITED — retry after Retry-After seconds.
  • 500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
Request
curl -X PATCH 'https://api.trovacast.com/v1/agents/AGENT_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "endCallPhrases": [
    "Goodbye",
    "Have a great day"
  ],
  "firstMessage": "Hello, this is Asha from Acme. Is this a good time?",
  "language": "hi-IN"
}'
Response 200 (json)
{
  "active": true,
  "archivedAt": "2026-11-05T10:00:00.000Z",
  "availability": {
    "reason": null,
    "runnable": true
  },
  "createdAt": "2026-11-05T10:00:00.000Z",
  "description": "DESCRIPTION",
  "endCallPhrases": [
    "END_CALL_PHRASES"
  ],
  "extraction": {
    "instructions": "INSTRUCTIONS",
    "schema": {}
  },
  "firstMessage": "FIRST_MESSAGE",
  "firstSpeaker": "agent",
  "id": "ID",
  "isDefault": true,
  "kind": "autonomous_voice",
  "language": "hi-IN",
  "livemode": true,
  "maxTurns": 1,
  "name": "NAME",
  "object": "agent",
  "reasoning": {
    "model": "MODEL",
    "provider": "openai"
  },
  "teamId": "TEAM_ID",
  "toolSigningSecret": "whsec_…",
  "toolSigningSecretLast4": "TOOL_SIGNING_SECRET_LAST4",
  "tools": [
    {
      "description": "DESCRIPTION",
      "name": "NAME",
      "parameters": {},
      "url": "URL"
    }
  ],
  "transcription": {
    "model": "ink-2",
    "provider": "auto"
  },
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1,
  "voice": {
    "model": "MODEL",
    "provider": "openai",
    "voiceId": "VOICE_ID"
  },
  "warnings": [
    {
      "agentId": "AGENT_ID",
      "callType": "manual",
      "code": "BILLING_RATE_UNAVAILABLE",
      "detail": true,
      "direction": "inbound",
      "flowId": "FLOW_ID",
      "message": "AI agent 0f9e… is switched off (AGENT_INACTIVE), so a caller who reaches the AI step at nodes.main.1 of this number's flow takes the step's fallback instead (AI_AGENT_UNAVAILABLE) until it is switched on (PATCH /v1/agents/0f9e… with active: true) or the step names another agent.",
      "numberId": "NUMBER_ID",
      "provider": "airtel",
      "reason": "voice_key_missing",
      "step": {
        "index": 1,
        "node": "main"
      }
    }
  ]
}

Delete agent

delete/v1/agents/{agentId}

Archives an AI agent.

Archives rather than deletes: the agent takes no new calls, stops being the default and is listed only with includeArchived=true; calls it ran keep their history, and it cannot be changed or restored afterwards. Answers the archived agent with warnings (2026-11-07; it answered 204 with no body before): every number the archive leaves failing — an AI step naming the agent in a routed flow, whose callers now take the step’s fallback (AI_AGENT_UNAVAILABLE, AGENT_INACTIVE) — in the shape PATCH /v1/agents/{agentId} answers; archiving an agent a routed flow names is allowed, as switching it off is (new calls and AI steps stop using it at once; a conversation already running finishes). Without numbers:read a warning carries only numberId, code and reason (detail: false). Idempotent: an archived agent answers 200 again, with what still names it. Refused with 409 AI_AGENT_IN_USE while a number’s ai route answers with the agent (re-route it with PATCH /v1/numbers/{numberId} first); a test key may archive only test agents (422 TEST_MODE_UNSUPPORTED).

Access: an organization key with the agents:write scope.

Path parameters

  • agentIdstringRequired

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 200PublicAgent

Archived (or already archived): the agent, with warnings ([] when no number is affected).

Show the 27 fields
  • activebooleanRequired

    Takes new calls.

  • archivedAtstring (date-time) | nullRequired

  • availabilityPublicAgentAvailabilityRequired

    Whether the agent can take a call on this deployment now, and why not. An agent that cannot is refused when it is saved (422 MODEL_UNAVAILABLE with the same reason); one saved before that check, or whose deployment lost a key since, reads runnable: false here.

    2 fields of availability
    • reasonstring | nullRequired

      Why not, when runnable is false: voice_key_missing (the voice provider has no key here), agent_id_missing (an ElevenLabs voice with no ElevenLabs agent id configured), transcription_key_missing (its speech-to-text has no key), reasoning_key_missing (a composite voice with no OpenAI or Anthropic key to write its replies). The same reason a call with the agent is refused with (422 AI_PROVIDER_UNAVAILABLE). Null when runnable.

      One ofvoice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missing

    • runnablebooleanRequired

      Whether a call with this agent would be admitted now: its voice provider has a key on this deployment, an ElevenLabs voice has an ElevenLabs agent id, and a composite voice has its transcription and reasoning keys — the check POST /v1/calls (mode: AI_AGENT) makes before anything is written. Read-only; it changes when the agent or the deployment does. A test agent on the mock voice is always runnable.

  • createdAtstring (date-time)Required

  • descriptionstring | nullRequired

  • endCallPhrasesstring[]Required

  • extractionPublicAgentExtraction | nullRequired

    2 fields of extraction
    • instructionsstring | nullRequired

    • schemaobjectRequired

  • firstMessagestring | nullRequired

  • firstSpeakerstringRequired

    Who speaks first on this agent’s calls — the one set, or its voice’s default.

    One ofagentcaller

  • idstring (uuid)Required

    What /v1/calls aiAgent.agentId takes.

  • isDefaultbooleanRequired

    The organization’s default agent of its kind.

  • kindstringRequired

    One ofautonomous_voicehybrid_voiceagent_assist

  • languagestring | nullRequired

  • livemodebooleanRequired

    false when a test key created it: it takes test calls only — never a live call, campaign, sequence or live flow — and cannot be the default. A live agent is read-only to a test key.

  • maxTurnsinteger | nullRequired

  • namestringRequired

  • objectstringRequired

    One ofagent

  • reasoningPublicAgentReasoning | nullRequired

    2 fields of reasoning
    • modelstringRequired

    • providerstringRequired

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock

  • teamIdstring | nullRequired

    The team the agent belongs to (agents made in the console can be a team’s); null for an organization-wide one.

  • toolSigningSecretstring

    The tool-signing secret, in the one response that minted it (the first tool given to the agent) — store it then. Rotate it with POST /v1/agents/:id/tool-secret.

  • toolSigningSecretLast4string | nullRequired

    The last four characters of the tool-signing secret; null until the agent has had a tool.

  • toolsPublicAgentTool[]Required

    4 fields of tools
    • descriptionstringRequired

    • namestringRequired

    • parametersobjectRequired

    • urlstringRequired

  • transcriptionPublicAgentTranscriptionRequired

    2 fields of transcription
    • modelstring | nullRequired

      One ofink-2ink-preview

    • providerstringRequired

      One ofautoelevenlabscartesia

  • updatedAtstring (date-time)Required

  • versionintegerRequired

  • voicePublicAgentVoiceRequired

    3 fields of voice
    • modelstringRequired

    • providerstringRequired

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock

    • voiceIdstring | nullRequired

  • warningsPublicAgentNumberWarning[]

    Only in the answer to PATCH /v1/agents/{agentId}: the organization’s numbers the change leaves failing, read after it — only warnings about the agent itself (AI_AGENT_UNAVAILABLE, AI_PROVIDER_UNAVAILABLE), never a price: each ai route to it (its calls are refused AI_AGENT_UNAVAILABLE) and each AI step naming it in a routed flow (the caller takes the step’s fallback), with the warning the number carries. Switching off an agent a number routes to is allowed — new calls, new AI steps and campaign dials stop using it at once, while a conversation already running finishes — and this lists what it stopped; [] when no number is affected (always for a test agent: a number takes live calls only).

    11 fields of warnings
    • agentIdstring (uuid) | nullRequired

      The AI agent the number’s route or step reaches; null for a key without numbers:read.

    • callTypestringRequired

      Always full_ai here: an AI route, or a flow’s AI step.

      One ofmanualfull_ai

    • codestringRequired

      As on the number’s own warnings, and here only ever about an AI agent: AI_AGENT_UNAVAILABLE (the agent cannot take the caller — reason AI_CALLS_DISABLED, AGENT_INACTIVE or TEST_AGENT) or AI_PROVIDER_UNAVAILABLE (its voice cannot run here — reason its availability.reason). One warning per cause, each with the same numberId (2026-11-07). Never BILLING_RATE_UNAVAILABLE.

      One ofBILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLE

    • detailbooleanRequired

      2026-11-07: whether the number’s details are in it. False for a key without numbers:read: only numberId, code and reason are told, the channel, agent, flow and step are null, and message names no route.

    • directionstringRequired

      One ofinbound

    • flowIdstring (uuid) | nullRequired

      2026-11-07: the routed flow (GET /v1/call-flows/{flowId}) whose AI step it is about; null for an ai route’s own warning, and for a key without numbers:read.

    • messagestringRequired

    • numberIdstring (uuid)Required

      The number (GET /v1/numbers/{numberId}), which carries this warning on every read until its cause goes.

    • providerstring | nullRequired

      The channel the number’s calls arrive on; null for a key without numbers:read.

      One ofairtelexotelplivosimtelnyxtwilio

    • reasonstring | nullRequired

      Why: AI_CALLS_DISABLED, AGENT_INACTIVE or TEST_AGENT for AI_AGENT_UNAVAILABLE; the agent’s availability.reason (lower case) for AI_PROVIDER_UNAVAILABLE.

      One ofvoice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENT

    • stepPublicNumberWarningStep | nullRequired

      The AI step of the routed flow it is about; null when it is about the route itself, and for a key without numbers:read.

      2 fields of step
      • indexintegerRequired

        Its position in the node, from 0: the step is nodes.<node>.<index> of the flow’s published version (the path POST /v1/call-flows/validate names its issues by).

        at least 0

      • nodestringRequired

        The node the step is in.

Errors

Request
curl -X DELETE 'https://api.trovacast.com/v1/agents/AGENT_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200 (json)
{
  "active": true,
  "archivedAt": "2026-11-05T10:00:00.000Z",
  "availability": {
    "reason": null,
    "runnable": true
  },
  "createdAt": "2026-11-05T10:00:00.000Z",
  "description": "DESCRIPTION",
  "endCallPhrases": [
    "END_CALL_PHRASES"
  ],
  "extraction": {
    "instructions": "INSTRUCTIONS",
    "schema": {}
  },
  "firstMessage": "FIRST_MESSAGE",
  "firstSpeaker": "agent",
  "id": "ID",
  "isDefault": true,
  "kind": "autonomous_voice",
  "language": "hi-IN",
  "livemode": true,
  "maxTurns": 1,
  "name": "NAME",
  "object": "agent",
  "reasoning": {
    "model": "MODEL",
    "provider": "openai"
  },
  "teamId": "TEAM_ID",
  "toolSigningSecret": "whsec_…",
  "toolSigningSecretLast4": "TOOL_SIGNING_SECRET_LAST4",
  "tools": [
    {
      "description": "DESCRIPTION",
      "name": "NAME",
      "parameters": {},
      "url": "URL"
    }
  ],
  "transcription": {
    "model": "ink-2",
    "provider": "auto"
  },
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1,
  "voice": {
    "model": "MODEL",
    "provider": "openai",
    "voiceId": "VOICE_ID"
  },
  "warnings": [
    {
      "agentId": "AGENT_ID",
      "callType": "manual",
      "code": "BILLING_RATE_UNAVAILABLE",
      "detail": true,
      "direction": "inbound",
      "flowId": "FLOW_ID",
      "message": "AI agent 0f9e… is switched off (AGENT_INACTIVE), so a caller who reaches the AI step at nodes.main.1 of this number's flow takes the step's fallback instead (AI_AGENT_UNAVAILABLE) until it is switched on (PATCH /v1/agents/0f9e… with active: true) or the step names another agent.",
      "numberId": "NUMBER_ID",
      "provider": "airtel",
      "reason": "voice_key_missing",
      "step": {
        "index": 1,
        "node": "main"
      }
    }
  ]
}

Rotate agent tool secret

post/v1/agents/{agentId}/tool-secret

Rotates the secret an AI agent signs its tool calls with.

Returns the new secret once, as secret (with last4); the previous one stops signing at once (a tool call is made live, so nothing waits signed with it). Refused for an archived agent (400); a test key may rotate only test agents (422 TEST_MODE_UNSUPPORTED). Audited against the key (ai_profile.tool_secret.rotate).

Access: an organization key with the agents:write scope.

Path parameters

  • agentIdstringRequired

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.

Response 200PublicAgentToolSecret

  • agentIdstring (uuid)Required

  • last4stringRequired

    4–4 characters

  • objectstringRequired

    One ofagent_tool_secret

  • secretstringRequired

    The new tool-signing secret — shown only here. The previous one stops verifying at once.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/agents/AGENT_ID/tool-secret' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200 (json)
{
  "agentId": "AGENT_ID",
  "last4": "LAST4",
  "object": "agent_tool_secret",
  "secret": "whsec_…"
}

List models

get/v1/models

Lists the models an AI agent can use, by provider and role.

Every catalogued model, with available: whether this deployment can run it (its provider is set up here). An agent naming an unavailable model is refused with 422 MODEL_UNAVAILABLE. A test key also sees the mock provider’s mock-voice and mock-reasoning (testOnly: true, always available): a test agent built on them runs test calls before the organization has any provider key. A live key never sees them, and a live agent cannot use them.

Access: an organization key with the agents:read scope.

Response 200PublicModelList

  • dataPublicModel[]Required

    7 fields of data
    • availablebooleanRequired

      Whether this deployment can run the model: its provider is set up here. An agent naming a model that is not available is refused (422 MODEL_UNAVAILABLE).

    • idstringRequired

    • labelstringRequired

    • objectstringRequired

      One ofmodel

    • providerstringRequired

      One ofopenaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock

    • rolesstring[]Required

      realtime (a voice leg, speech to speech), reasoning (conversation turns, coaching, grading), tts (speech synthesis), stt (transcription).

      One ofrealtimereasoningttsstt

    • testOnlybooleanRequired

      True for the mock provider’s models — listed to test keys only, for building an AI agent before the organization adds a provider key. A test agent may use them; a live one may not.

Errors

Request
curl 'https://api.trovacast.com/v1/models' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "available": true,
      "id": "gpt-realtime",
      "label": "GPT Realtime",
      "object": "model",
      "provider": "openai",
      "roles": [
        "realtime"
      ],
      "testOnly": true
    }
  ]
}