API reference
AI agents
How these fit together: the AI voice agents guide.
List agents
get
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
limitintegerHow many items to return.
cursorstringThe
nextCursorof the previous page. Omit for the first page.includeArchivedbooleanInclude archived agents.
Response 200PublicAgentPage
dataPublicAgent[]Required27 fields of
dataactivebooleanRequiredTakes new calls.
archivedAtstring (date-time) | nullRequiredavailabilityPublicAgentAvailabilityRequiredWhether 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_UNAVAILABLEwith the samereason); one saved before that check, or whose deployment lost a key since, readsrunnable: falsehere.2 fields of
availabilityreasonstring | nullRequiredWhy not, when
runnableis 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 samereasona call with the agent is refused with (422 AI_PROVIDER_UNAVAILABLE). Null when runnable.One of
voice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingrunnablebooleanRequiredWhether 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 themockvoice is always runnable.
createdAtstring (date-time)Requireddescriptionstring | nullRequiredendCallPhrasesstring[]RequiredextractionPublicAgentExtraction | nullRequired2 fields of
extractioninstructionsstring | nullRequiredschemaobjectRequired
firstMessagestring | nullRequiredfirstSpeakerstringRequiredWho speaks first on this agent’s calls — the one set, or its voice’s default.
One of
agentcalleridstring (uuid)RequiredWhat
/v1/callsaiAgent.agentIdtakes.isDefaultbooleanRequiredThe organization’s default agent of its kind.
kindstringRequiredOne of
autonomous_voicehybrid_voiceagent_assistlanguagestring | nullRequiredlivemodebooleanRequiredfalse 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 | nullRequirednamestringRequiredobjectstringRequiredOne of
agentreasoningPublicAgentReasoning | nullRequired2 fields of
reasoningmodelstringRequiredproviderstringRequiredOne of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock
teamIdstring | nullRequiredThe team the agent belongs to (agents made in the console can be a team’s); null for an organization-wide one.
toolSigningSecretstringThe 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 | nullRequiredThe last four characters of the tool-signing secret; null until the agent has had a tool.
toolsPublicAgentTool[]Required4 fields of
toolsdescriptionstringRequirednamestringRequiredparametersobjectRequiredurlstringRequired
transcriptionPublicAgentTranscriptionRequired2 fields of
transcriptionmodelstring | nullRequiredOne of
ink-2ink-previewproviderstringRequiredOne of
autoelevenlabscartesia
updatedAtstring (date-time)RequiredversionintegerRequiredvoicePublicAgentVoiceRequired3 fields of
voicemodelstringRequiredproviderstringRequiredOne of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockvoiceIdstring | 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: eachairoute to it (its calls are refusedAI_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
warningsagentIdstring (uuid) | nullRequiredThe AI agent the number’s route or step reaches; null for a key without
numbers:read.callTypestringRequiredAlways
full_aihere: an AI route, or a flow’s AI step.One of
manualfull_aicodestringRequiredAs on the number’s own
warnings, and here only ever about an AI agent:AI_AGENT_UNAVAILABLE(the agent cannot take the caller —reasonAI_CALLS_DISABLED,AGENT_INACTIVEorTEST_AGENT) orAI_PROVIDER_UNAVAILABLE(its voice cannot run here —reasonitsavailability.reason). One warning per cause, each with the samenumberId(2026-11-07). NeverBILLING_RATE_UNAVAILABLE.One of
BILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLEdetailbooleanRequired2026-11-07: whether the number’s details are in it. False for a key without
numbers:read: onlynumberId,codeandreasonare told, the channel, agent, flow and step are null, andmessagenames no route.directionstringRequiredOne of
inboundflowIdstring (uuid) | nullRequired2026-11-07: the routed flow (
GET /v1/call-flows/{flowId}) whose AI step it is about; null for anairoute’s own warning, and for a key withoutnumbers:read.messagestringRequirednumberIdstring (uuid)RequiredThe number (
GET /v1/numbers/{numberId}), which carries this warning on every read until its cause goes.providerstring | nullRequiredThe channel the number’s calls arrive on; null for a key without
numbers:read.One of
airtelexotelplivosimtelnyxtwilioreasonstring | nullRequiredWhy:
AI_CALLS_DISABLED,AGENT_INACTIVEorTEST_AGENTforAI_AGENT_UNAVAILABLE; the agent’savailability.reason(lower case) forAI_PROVIDER_UNAVAILABLE.One of
voice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENTstepPublicNumberWarningStep | nullRequiredThe 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
stepindexintegerRequiredIts position in the node, from 0: the step is
nodes.<node>.<index>of the flow’s published version (the pathPOST /v1/call-flows/validatenames its issues by).at least 0
nodestringRequiredThe node the step is in.
nextCursorstring | nullRequiredPass back as
cursorfor the next page; null on the last.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/agents' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"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
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-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
descriptionstringat most 1000 characters
endCallPhrasesstring[] | nullThe 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 | nullStructured data to pull out of each finished call’s transcript — on
GET /v1/calls/:id/summaryandcall.summary.readyasextraction.2 fields of
extractioninstructionsstring | nullGuidance for the extraction (units, formats, what counts).
at most 2000 characters
schemaobjectRequiredWhat 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 | nullSaid word for word when the call connects (the agent speaks first). Not with
firstSpeaker: caller.at most 1000 characters
firstSpeakerstring | nullagent: the agent opens — withfirstMessage, 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 of
agentcallerinstructionsstringRequiredThe agent’s instructions (system prompt / script). Stored encrypted.
10–20000 characters
isDefaultbooleanThe organization’s default agent of its kind.
default false
kindstringautonomous_voiceruns a call on its own (/v1/callsAI_AGENT);hybrid_voicehands to a person;agent_assistcoaches a person on the desk. Either case is accepted; lower case is canonical (what responses andGET /v1/modelsanswer).One of
agent_assistautonomous_voicehybrid_voiceAGENT_ASSISTAUTONOMOUS_VOICEHYBRID_VOICEdefault "autonomous_voice"
languagestring | nullA 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-inreadshi-IN).at most 35 characters
maxTurnsinteger | nullThe agent hangs up after this many replies of its own (its closing line plays first).
1–200
namestringRequired2–160 characters
reasoningPublicAgentReasoningInput2 fields of
reasoningmodelstringRequiredat most 160 characters
providerstringThe voice provider when unset. Either case is accepted; lower case is canonical (what responses and
GET /v1/modelsanswer).One of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockOPENAIANTHROPICELEVENLABSSARVAMCARTESIAAWS_NOVA_SONICMOCK
toolsPublicAgentToolInput[] | nullFunctions the agent may call mid-call (replaces the list;
[]ornullremoves them). The first tool mints the agent’s tool-signing secret, answered once astoolSigningSecret. Used by the OpenAI realtime and composite voices; an ElevenLabs agent uses the tools configured at ElevenLabs.at most 10 items
4 fields of
toolsdescriptionstringRequiredWhen the model should use it — the model reads this.
1–1000 characters
namestringRequiredWhat the model calls it: a letter, then letters, digits,
_or-(at most 64). Unique within the agent.parametersobjectRequiredThe 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.urlstringRequiredYour 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). Answer2xxJSON 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
transcriptionPublicAgentTranscriptionInput2 fields of
transcriptionmodelstringEither case is accepted; lower case is canonical (what responses and
GET /v1/modelsanswer).One of
ink-2ink-previewINK-2INK-PREVIEWproviderstringRequiredautolets the platform choose. Either case is accepted; lower case is canonical (what responses andGET /v1/modelsanswer).One of
autoelevenlabscartesiaAUTOELEVENLABSCARTESIA
voicePublicAgentVoiceInputRequired3 fields of
voicemodelstringRequiredA model the provider serves for the voice leg (
GET /v1/models); an unknown id is refused here, never mid-call.at most 160 characters
providerstringRequiredWho runs the voice (media) leg. Either case is accepted; lower case is canonical (what responses and
GET /v1/modelsanswer).mock(withmock-voice/mock-reasoning) is the test-mode voice and model: a test key’s agent only, no provider key needed (a live key is refused422 MODEL_UNAVAILABLE).One of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockOPENAIANTHROPICELEVENLABSSARVAMCARTESIAAWS_NOVA_SONICMOCKvoiceIdstringThe provider’s voice id; its default when unset.
at most 255 characters
Response 201PublicAgent
Show the 27 fieldsHide the fields
activebooleanRequiredTakes new calls.
archivedAtstring (date-time) | nullRequiredavailabilityPublicAgentAvailabilityRequiredWhether 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_UNAVAILABLEwith the samereason); one saved before that check, or whose deployment lost a key since, readsrunnable: falsehere.2 fields of
availabilityreasonstring | nullRequiredWhy not, when
runnableis 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 samereasona call with the agent is refused with (422 AI_PROVIDER_UNAVAILABLE). Null when runnable.One of
voice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingrunnablebooleanRequiredWhether 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 themockvoice is always runnable.
createdAtstring (date-time)Requireddescriptionstring | nullRequiredendCallPhrasesstring[]RequiredextractionPublicAgentExtraction | nullRequired2 fields of
extractioninstructionsstring | nullRequiredschemaobjectRequired
firstMessagestring | nullRequiredfirstSpeakerstringRequiredWho speaks first on this agent’s calls — the one set, or its voice’s default.
One of
agentcalleridstring (uuid)RequiredWhat
/v1/callsaiAgent.agentIdtakes.isDefaultbooleanRequiredThe organization’s default agent of its kind.
kindstringRequiredOne of
autonomous_voicehybrid_voiceagent_assistlanguagestring | nullRequiredlivemodebooleanRequiredfalse 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 | nullRequirednamestringRequiredobjectstringRequiredOne of
agentreasoningPublicAgentReasoning | nullRequired2 fields of
reasoningmodelstringRequiredproviderstringRequiredOne of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock
teamIdstring | nullRequiredThe team the agent belongs to (agents made in the console can be a team’s); null for an organization-wide one.
toolSigningSecretstringThe 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 | nullRequiredThe last four characters of the tool-signing secret; null until the agent has had a tool.
toolsPublicAgentTool[]Required4 fields of
toolsdescriptionstringRequirednamestringRequiredparametersobjectRequiredurlstringRequired
transcriptionPublicAgentTranscriptionRequired2 fields of
transcriptionmodelstring | nullRequiredOne of
ink-2ink-previewproviderstringRequiredOne of
autoelevenlabscartesia
updatedAtstring (date-time)RequiredversionintegerRequiredvoicePublicAgentVoiceRequired3 fields of
voicemodelstringRequiredproviderstringRequiredOne of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockvoiceIdstring | 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: eachairoute to it (its calls are refusedAI_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
warningsagentIdstring (uuid) | nullRequiredThe AI agent the number’s route or step reaches; null for a key without
numbers:read.callTypestringRequiredAlways
full_aihere: an AI route, or a flow’s AI step.One of
manualfull_aicodestringRequiredAs on the number’s own
warnings, and here only ever about an AI agent:AI_AGENT_UNAVAILABLE(the agent cannot take the caller —reasonAI_CALLS_DISABLED,AGENT_INACTIVEorTEST_AGENT) orAI_PROVIDER_UNAVAILABLE(its voice cannot run here —reasonitsavailability.reason). One warning per cause, each with the samenumberId(2026-11-07). NeverBILLING_RATE_UNAVAILABLE.One of
BILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLEdetailbooleanRequired2026-11-07: whether the number’s details are in it. False for a key without
numbers:read: onlynumberId,codeandreasonare told, the channel, agent, flow and step are null, andmessagenames no route.directionstringRequiredOne of
inboundflowIdstring (uuid) | nullRequired2026-11-07: the routed flow (
GET /v1/call-flows/{flowId}) whose AI step it is about; null for anairoute’s own warning, and for a key withoutnumbers:read.messagestringRequirednumberIdstring (uuid)RequiredThe number (
GET /v1/numbers/{numberId}), which carries this warning on every read until its cause goes.providerstring | nullRequiredThe channel the number’s calls arrive on; null for a key without
numbers:read.One of
airtelexotelplivosimtelnyxtwilioreasonstring | nullRequiredWhy:
AI_CALLS_DISABLED,AGENT_INACTIVEorTEST_AGENTforAI_AGENT_UNAVAILABLE; the agent’savailability.reason(lower case) forAI_PROVIDER_UNAVAILABLE.One of
voice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENTstepPublicNumberWarningStep | nullRequiredThe 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
stepindexintegerRequiredIts position in the node, from 0: the step is
nodes.<node>.<index>of the flow’s published version (the pathPOST /v1/call-flows/validatenames its issues by).at least 0
nodestringRequiredThe node the step is in.
Errors
400VALIDATION_FAILED — a model the provider does not serve for that leg (seeGET /v1/models), a voice that model cannot use, a default that is not organization-wide; or afirstMessagewithfirstSpeaker: 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 anagent_assistagent.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/modelsmarks each modelavailable); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
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."
}'{
"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
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 fieldsHide the fields
activebooleanRequiredTakes new calls.
archivedAtstring (date-time) | nullRequiredavailabilityPublicAgentAvailabilityRequiredWhether 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_UNAVAILABLEwith the samereason); one saved before that check, or whose deployment lost a key since, readsrunnable: falsehere.2 fields of
availabilityreasonstring | nullRequiredWhy not, when
runnableis 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 samereasona call with the agent is refused with (422 AI_PROVIDER_UNAVAILABLE). Null when runnable.One of
voice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingrunnablebooleanRequiredWhether 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 themockvoice is always runnable.
createdAtstring (date-time)Requireddescriptionstring | nullRequiredendCallPhrasesstring[]RequiredextractionPublicAgentExtraction | nullRequired2 fields of
extractioninstructionsstring | nullRequiredschemaobjectRequired
firstMessagestring | nullRequiredfirstSpeakerstringRequiredWho speaks first on this agent’s calls — the one set, or its voice’s default.
One of
agentcalleridstring (uuid)RequiredWhat
/v1/callsaiAgent.agentIdtakes.instructionsstring | nullRequiredThe instructions, on a single-agent read only; null when they cannot be decrypted (a lost key — rewrite them).
isDefaultbooleanRequiredThe organization’s default agent of its kind.
kindstringRequiredOne of
autonomous_voicehybrid_voiceagent_assistlanguagestring | nullRequiredlivemodebooleanRequiredfalse 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 | nullRequirednamestringRequiredobjectstringRequiredOne of
agentreasoningPublicAgentReasoning | nullRequired2 fields of
reasoningmodelstringRequiredproviderstringRequiredOne of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock
teamIdstring | nullRequiredThe team the agent belongs to (agents made in the console can be a team’s); null for an organization-wide one.
toolSigningSecretstringThe 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 | nullRequiredThe last four characters of the tool-signing secret; null until the agent has had a tool.
toolsPublicAgentTool[]Required4 fields of
toolsdescriptionstringRequirednamestringRequiredparametersobjectRequiredurlstringRequired
transcriptionPublicAgentTranscriptionRequired2 fields of
transcriptionmodelstring | nullRequiredOne of
ink-2ink-previewproviderstringRequiredOne of
autoelevenlabscartesia
updatedAtstring (date-time)RequiredversionintegerRequiredvoicePublicAgentVoiceRequired3 fields of
voicemodelstringRequiredproviderstringRequiredOne of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockvoiceIdstring | 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: eachairoute to it (its calls are refusedAI_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
warningsagentIdstring (uuid) | nullRequiredThe AI agent the number’s route or step reaches; null for a key without
numbers:read.callTypestringRequiredAlways
full_aihere: an AI route, or a flow’s AI step.One of
manualfull_aicodestringRequiredAs on the number’s own
warnings, and here only ever about an AI agent:AI_AGENT_UNAVAILABLE(the agent cannot take the caller —reasonAI_CALLS_DISABLED,AGENT_INACTIVEorTEST_AGENT) orAI_PROVIDER_UNAVAILABLE(its voice cannot run here —reasonitsavailability.reason). One warning per cause, each with the samenumberId(2026-11-07). NeverBILLING_RATE_UNAVAILABLE.One of
BILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLEdetailbooleanRequired2026-11-07: whether the number’s details are in it. False for a key without
numbers:read: onlynumberId,codeandreasonare told, the channel, agent, flow and step are null, andmessagenames no route.directionstringRequiredOne of
inboundflowIdstring (uuid) | nullRequired2026-11-07: the routed flow (
GET /v1/call-flows/{flowId}) whose AI step it is about; null for anairoute’s own warning, and for a key withoutnumbers:read.messagestringRequirednumberIdstring (uuid)RequiredThe number (
GET /v1/numbers/{numberId}), which carries this warning on every read until its cause goes.providerstring | nullRequiredThe channel the number’s calls arrive on; null for a key without
numbers:read.One of
airtelexotelplivosimtelnyxtwilioreasonstring | nullRequiredWhy:
AI_CALLS_DISABLED,AGENT_INACTIVEorTEST_AGENTforAI_AGENT_UNAVAILABLE; the agent’savailability.reason(lower case) forAI_PROVIDER_UNAVAILABLE.One of
voice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENTstepPublicNumberWarningStep | nullRequiredThe 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
stepindexintegerRequiredIts position in the node, from 0: the step is
nodes.<node>.<index>of the flow’s published version (the pathPOST /v1/call-flows/validatenames its issues by).at least 0
nodestringRequiredThe node the step is in.
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 agent.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/agents/AGENT_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"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
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-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
activebooleanSwitch the agent off (or on) without archiving it.
descriptionstringat most 1000 characters
endCallPhrasesstring[] | nullThe 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 | nullStructured data to pull out of each finished call’s transcript — on
GET /v1/calls/:id/summaryandcall.summary.readyasextraction.2 fields of
extractioninstructionsstring | nullGuidance for the extraction (units, formats, what counts).
at most 2000 characters
schemaobjectRequiredWhat 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 | nullSaid word for word when the call connects (the agent speaks first). Not with
firstSpeaker: caller.at most 1000 characters
firstSpeakerstring | nullagent: the agent opens — withfirstMessage, 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 of
agentcallerinstructionsstring10–20000 characters
isDefaultbooleanlanguagestring | nullA 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-inreadshi-IN).at most 35 characters
maxTurnsinteger | nullThe agent hangs up after this many replies of its own (its closing line plays first).
1–200
namestring2–160 characters
reasoningPublicAgentReasoningInput2 fields of
reasoningmodelstringRequiredat most 160 characters
providerstringThe voice provider when unset. Either case is accepted; lower case is canonical (what responses and
GET /v1/modelsanswer).One of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockOPENAIANTHROPICELEVENLABSSARVAMCARTESIAAWS_NOVA_SONICMOCK
toolsPublicAgentToolInput[] | nullFunctions the agent may call mid-call (replaces the list;
[]ornullremoves them). The first tool mints the agent’s tool-signing secret, answered once astoolSigningSecret. Used by the OpenAI realtime and composite voices; an ElevenLabs agent uses the tools configured at ElevenLabs.at most 10 items
4 fields of
toolsdescriptionstringRequiredWhen the model should use it — the model reads this.
1–1000 characters
namestringRequiredWhat the model calls it: a letter, then letters, digits,
_or-(at most 64). Unique within the agent.parametersobjectRequiredThe 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.urlstringRequiredYour 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). Answer2xxJSON 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
transcriptionPublicAgentTranscriptionInput2 fields of
transcriptionmodelstringEither case is accepted; lower case is canonical (what responses and
GET /v1/modelsanswer).One of
ink-2ink-previewINK-2INK-PREVIEWproviderstringRequiredautolets the platform choose. Either case is accepted; lower case is canonical (what responses andGET /v1/modelsanswer).One of
autoelevenlabscartesiaAUTOELEVENLABSCARTESIA
versionintegerThe
versionyou read (409when it moved). Omitted: last write wins.voicePublicAgentVoiceInput3 fields of
voicemodelstringRequiredA model the provider serves for the voice leg (
GET /v1/models); an unknown id is refused here, never mid-call.at most 160 characters
providerstringRequiredWho runs the voice (media) leg. Either case is accepted; lower case is canonical (what responses and
GET /v1/modelsanswer).mock(withmock-voice/mock-reasoning) is the test-mode voice and model: a test key’s agent only, no provider key needed (a live key is refused422 MODEL_UNAVAILABLE).One of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockOPENAIANTHROPICELEVENLABSSARVAMCARTESIAAWS_NOVA_SONICMOCKvoiceIdstringThe provider’s voice id; its default when unset.
at most 255 characters
Response 200PublicAgent
Show the 27 fieldsHide the fields
activebooleanRequiredTakes new calls.
archivedAtstring (date-time) | nullRequiredavailabilityPublicAgentAvailabilityRequiredWhether 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_UNAVAILABLEwith the samereason); one saved before that check, or whose deployment lost a key since, readsrunnable: falsehere.2 fields of
availabilityreasonstring | nullRequiredWhy not, when
runnableis 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 samereasona call with the agent is refused with (422 AI_PROVIDER_UNAVAILABLE). Null when runnable.One of
voice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingrunnablebooleanRequiredWhether 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 themockvoice is always runnable.
createdAtstring (date-time)Requireddescriptionstring | nullRequiredendCallPhrasesstring[]RequiredextractionPublicAgentExtraction | nullRequired2 fields of
extractioninstructionsstring | nullRequiredschemaobjectRequired
firstMessagestring | nullRequiredfirstSpeakerstringRequiredWho speaks first on this agent’s calls — the one set, or its voice’s default.
One of
agentcalleridstring (uuid)RequiredWhat
/v1/callsaiAgent.agentIdtakes.isDefaultbooleanRequiredThe organization’s default agent of its kind.
kindstringRequiredOne of
autonomous_voicehybrid_voiceagent_assistlanguagestring | nullRequiredlivemodebooleanRequiredfalse 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 | nullRequirednamestringRequiredobjectstringRequiredOne of
agentreasoningPublicAgentReasoning | nullRequired2 fields of
reasoningmodelstringRequiredproviderstringRequiredOne of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock
teamIdstring | nullRequiredThe team the agent belongs to (agents made in the console can be a team’s); null for an organization-wide one.
toolSigningSecretstringThe 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 | nullRequiredThe last four characters of the tool-signing secret; null until the agent has had a tool.
toolsPublicAgentTool[]Required4 fields of
toolsdescriptionstringRequirednamestringRequiredparametersobjectRequiredurlstringRequired
transcriptionPublicAgentTranscriptionRequired2 fields of
transcriptionmodelstring | nullRequiredOne of
ink-2ink-previewproviderstringRequiredOne of
autoelevenlabscartesia
updatedAtstring (date-time)RequiredversionintegerRequiredvoicePublicAgentVoiceRequired3 fields of
voicemodelstringRequiredproviderstringRequiredOne of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockvoiceIdstring | 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: eachairoute to it (its calls are refusedAI_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
warningsagentIdstring (uuid) | nullRequiredThe AI agent the number’s route or step reaches; null for a key without
numbers:read.callTypestringRequiredAlways
full_aihere: an AI route, or a flow’s AI step.One of
manualfull_aicodestringRequiredAs on the number’s own
warnings, and here only ever about an AI agent:AI_AGENT_UNAVAILABLE(the agent cannot take the caller —reasonAI_CALLS_DISABLED,AGENT_INACTIVEorTEST_AGENT) orAI_PROVIDER_UNAVAILABLE(its voice cannot run here —reasonitsavailability.reason). One warning per cause, each with the samenumberId(2026-11-07). NeverBILLING_RATE_UNAVAILABLE.One of
BILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLEdetailbooleanRequired2026-11-07: whether the number’s details are in it. False for a key without
numbers:read: onlynumberId,codeandreasonare told, the channel, agent, flow and step are null, andmessagenames no route.directionstringRequiredOne of
inboundflowIdstring (uuid) | nullRequired2026-11-07: the routed flow (
GET /v1/call-flows/{flowId}) whose AI step it is about; null for anairoute’s own warning, and for a key withoutnumbers:read.messagestringRequirednumberIdstring (uuid)RequiredThe number (
GET /v1/numbers/{numberId}), which carries this warning on every read until its cause goes.providerstring | nullRequiredThe channel the number’s calls arrive on; null for a key without
numbers:read.One of
airtelexotelplivosimtelnyxtwilioreasonstring | nullRequiredWhy:
AI_CALLS_DISABLED,AGENT_INACTIVEorTEST_AGENTforAI_AGENT_UNAVAILABLE; the agent’savailability.reason(lower case) forAI_PROVIDER_UNAVAILABLE.One of
voice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENTstepPublicNumberWarningStep | nullRequiredThe 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
stepindexintegerRequiredIts position in the node, from 0: the step is
nodes.<node>.<index>of the flow’s published version (the pathPOST /v1/call-flows/validatenames its issues by).at least 0
nodestringRequiredThe node the step is in.
Errors
400VALIDATION_FAILED — a model the provider does not serve for that leg (seeGET /v1/models), a voice that model cannot use, a default that is not organization-wide; or afirstMessagewithfirstSpeaker: 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 anagent_assistagent. 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 theversionsent (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/modelsmarks each modelavailable); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
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"
}'{
"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
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-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. This endpoint converges when run again, so a 5xx stores nothing either: a retry with the same key runs it again. 1–255 visible ASCII characters; kept for 24 hours.
Response 200PublicAgent
Archived (or already archived): the agent, with warnings ([] when no number is affected).
Show the 27 fieldsHide the fields
activebooleanRequiredTakes new calls.
archivedAtstring (date-time) | nullRequiredavailabilityPublicAgentAvailabilityRequiredWhether 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_UNAVAILABLEwith the samereason); one saved before that check, or whose deployment lost a key since, readsrunnable: falsehere.2 fields of
availabilityreasonstring | nullRequiredWhy not, when
runnableis 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 samereasona call with the agent is refused with (422 AI_PROVIDER_UNAVAILABLE). Null when runnable.One of
voice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingrunnablebooleanRequiredWhether 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 themockvoice is always runnable.
createdAtstring (date-time)Requireddescriptionstring | nullRequiredendCallPhrasesstring[]RequiredextractionPublicAgentExtraction | nullRequired2 fields of
extractioninstructionsstring | nullRequiredschemaobjectRequired
firstMessagestring | nullRequiredfirstSpeakerstringRequiredWho speaks first on this agent’s calls — the one set, or its voice’s default.
One of
agentcalleridstring (uuid)RequiredWhat
/v1/callsaiAgent.agentIdtakes.isDefaultbooleanRequiredThe organization’s default agent of its kind.
kindstringRequiredOne of
autonomous_voicehybrid_voiceagent_assistlanguagestring | nullRequiredlivemodebooleanRequiredfalse 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 | nullRequirednamestringRequiredobjectstringRequiredOne of
agentreasoningPublicAgentReasoning | nullRequired2 fields of
reasoningmodelstringRequiredproviderstringRequiredOne of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmock
teamIdstring | nullRequiredThe team the agent belongs to (agents made in the console can be a team’s); null for an organization-wide one.
toolSigningSecretstringThe 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 | nullRequiredThe last four characters of the tool-signing secret; null until the agent has had a tool.
toolsPublicAgentTool[]Required4 fields of
toolsdescriptionstringRequirednamestringRequiredparametersobjectRequiredurlstringRequired
transcriptionPublicAgentTranscriptionRequired2 fields of
transcriptionmodelstring | nullRequiredOne of
ink-2ink-previewproviderstringRequiredOne of
autoelevenlabscartesia
updatedAtstring (date-time)RequiredversionintegerRequiredvoicePublicAgentVoiceRequired3 fields of
voicemodelstringRequiredproviderstringRequiredOne of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockvoiceIdstring | 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: eachairoute to it (its calls are refusedAI_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
warningsagentIdstring (uuid) | nullRequiredThe AI agent the number’s route or step reaches; null for a key without
numbers:read.callTypestringRequiredAlways
full_aihere: an AI route, or a flow’s AI step.One of
manualfull_aicodestringRequiredAs on the number’s own
warnings, and here only ever about an AI agent:AI_AGENT_UNAVAILABLE(the agent cannot take the caller —reasonAI_CALLS_DISABLED,AGENT_INACTIVEorTEST_AGENT) orAI_PROVIDER_UNAVAILABLE(its voice cannot run here —reasonitsavailability.reason). One warning per cause, each with the samenumberId(2026-11-07). NeverBILLING_RATE_UNAVAILABLE.One of
BILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLEdetailbooleanRequired2026-11-07: whether the number’s details are in it. False for a key without
numbers:read: onlynumberId,codeandreasonare told, the channel, agent, flow and step are null, andmessagenames no route.directionstringRequiredOne of
inboundflowIdstring (uuid) | nullRequired2026-11-07: the routed flow (
GET /v1/call-flows/{flowId}) whose AI step it is about; null for anairoute’s own warning, and for a key withoutnumbers:read.messagestringRequirednumberIdstring (uuid)RequiredThe number (
GET /v1/numbers/{numberId}), which carries this warning on every read until its cause goes.providerstring | nullRequiredThe channel the number’s calls arrive on; null for a key without
numbers:read.One of
airtelexotelplivosimtelnyxtwilioreasonstring | nullRequiredWhy:
AI_CALLS_DISABLED,AGENT_INACTIVEorTEST_AGENTforAI_AGENT_UNAVAILABLE; the agent’savailability.reason(lower case) forAI_PROVIDER_UNAVAILABLE.One of
voice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENTstepPublicNumberWarningStep | nullRequiredThe 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
stepindexintegerRequiredIts position in the node, from 0: the step is
nodes.<node>.<index>of the flow’s published version (the pathPOST /v1/call-flows/validatenames its issues by).at least 0
nodestringRequiredThe node the step is in.
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 agent.409AI_AGENT_IN_USE — a number routes its inbound calls to this agent; re-route it first (PATCH /v1/numbers/:id). 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/modelsmarks each modelavailable); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl -X DELETE 'https://api.trovacast.com/v1/agents/AGENT_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"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
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-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Response 200PublicAgentToolSecret
agentIdstring (uuid)Requiredlast4stringRequired4–4 characters
objectstringRequiredOne of
agent_tool_secretsecretstringRequiredThe new tool-signing secret — shown only here. The previous one stops verifying at once.
Errors
400VALIDATION_FAILED — 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.409IDEMPOTENCY_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/modelsmarks each modelavailable); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X POST 'https://api.trovacast.com/v1/agents/AGENT_ID/tool-secret' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"agentId": "AGENT_ID",
"last4": "LAST4",
"object": "agent_tool_secret",
"secret": "whsec_…"
}List models
get
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[]Required7 fields of
dataavailablebooleanRequiredWhether 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).idstringRequiredlabelstringRequiredobjectstringRequiredOne of
modelproviderstringRequiredOne of
openaianthropicelevenlabssarvamcartesiaaws_nova_sonicmockrolesstring[]Requiredrealtime(a voice leg, speech to speech),reasoning(conversation turns, coaching, grading),tts(speech synthesis),stt(transcription).One of
realtimereasoningttsstttestOnlybooleanRequiredTrue for the
mockprovider’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
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/models' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"data": [
{
"available": true,
"id": "gpt-realtime",
"label": "GPT Realtime",
"object": "model",
"provider": "openai",
"roles": [
"realtime"
],
"testOnly": true
}
]
}