Skip to main content
The API reference covers every field on the agent object. This page covers the parts that need more context than a schema can give: agent fields, model configuration, system prompt structure, tools, and template variables. You can manage agents through the API or through Agent Infra. For working code examples (create, update, delete), see Agent API examples.

Agent fields

Required fields

Common optional fields

Models

The models object configures the STT, LLM, and TTS models used by the agent runtime:

Supported LLMs

llm accepts one of the following model IDs:

Fallbacks and timeouts

Writing a system prompt

A system prompt tells the agent who it is, how to talk, and what to do on the call. We recommend splitting it into five sections:
A few things worth calling out:
  • Keep it spoken. The output goes through TTS, so write the way you’d actually talk. No markdown formatting, no numbered lists in the agent’s responses.
  • One question per turn. Stacking questions confuses both the caller and the STT model.
  • Use <wait for response> markers. They make the conversation flow explicit for the LLM.
  • Normalize for speech. Phone numbers, dates, and times should be written out the way you’d say them aloud.

Tools

Agents support four tool types. You pass them in the tools array when creating or updating an agent.

Template tools

Two built-in templates: hangup and voicemail_detection. These handle call control without any backend setup.
The execution_policy.pre_action_message tells the agent to say something before executing the tool. For hangup, the agent will speak the text and then end the call. You can override the default tool prompt with the prompt field if you want to change when the LLM decides to use the tool.

Current date/time tool

Use the current_datetime built-in when the agent needs reliable time-sensitive context without calling your backend.
At runtime this becomes a get_current_datetime tool and returns a JSON object with:
  • timezone
  • local_datetime
  • local_date
  • local_time
  • day_of_week
  • utc_offset
  • is_dst
Like webhook tools, you can also configure it with "source": "system" and system.triggers if you want the runtime to inject current date/time context automatically on events like call_start.

Webhook tools

Webhook tools call your backend over HTTP. The LLM decides when to invoke them based on the name and description you provide. Parameters follow JSON Schema.
Authentication: Two options:
  • "auth": { "type": "bearer", "token": "..." } sends an Authorization: Bearer <token> header
  • "auth": { "type": "hmac", "secret": "..." } sends an X-Signature-256 header (HMAC-SHA256 of the request body)
Secrets are write-only. The API never returns them. Fire-and-forget: Set "wait_for_response": false when you don’t need the result back in the conversation, like logging a call event to your CRM. Result visibility: Use "show_results_to_llm": false when a webhook should run but the successful response body should stay hidden from the model. Use llm_result_instructions to tell the model how to use a successful response when it is visible. llm_result_instructions is static configuration and does not support runtime personalization. URL personalization: Webhook URLs may use {{variables}}, but only in path segments and query parameter values. The scheme, host, port, credentials, fragments, and query parameter names must remain literal.

System-triggered webhooks

By default, webhook tools are "source": "contextual": the LLM calls them during conversation. Set "source": "system" to trigger them automatically on specific events instead.
Available trigger events: call_start, first_user_message, call_end, tool_succeeded, tool_failed. For tool_succeeded and tool_failed, you also need to set source_tool_id to specify which tool’s outcome fires the trigger. Arguments can pull from several sources: System webhook description, llm_result_instructions, and execution_policy.pre_action_message.text must remain static. Only url and system.arguments[*].source.template support runtime personalization for webhook tools.

Human transfer

Transfers the caller to a phone number. Requires an outbound SIP trunk on the agent.
The LLM uses the name and description to decide when to transfer, just like webhook tools.

Idle nudges

idle_nudges configures what the runtime should do when the caller goes silent for too long.
If you omit idle_nudges, the backend can apply language-specific defaults when returning the agent configuration.

Tool personalization

Tool personalization uses the same {{variable}} syntax as prompts and greetings, but only on runtime-safe tool fields. Tool fields are validated when the tool runs rather than when the call starts.
  • Prompt and greeting variables are start-critical. Missing values can block the session.
  • Tool-only variables are runtime-only. Missing or invalid values fail the tool, not the call.
Supported surfaces in v1:
Validation rules:
  • URLs must resolve to a full http:// or https:// URL while preserving the configured origin.
  • URL placeholders are allowed only in path segments and query parameter values, and rejected in scheme, host, port, user info, fragments, and query parameter names.
  • phone_number must resolve to E.164, for example +34600111222.
  • timezone must resolve to an IANA timezone, for example Europe/Madrid.
  • Templated system argument values are scalar-only in v1. Arrays must remain literal constants.
  • description, llm_result_instructions, and pre-action message text are static configuration and do not support runtime personalization.
Runtime arguments are bounded:
  • Maximum 32 keys
  • Maximum key length 64 characters
  • Maximum value length 1024 characters
  • Maximum combined value length 8192 characters
  • Template substitution only. Expressions and formulas are not supported.

Template variables

Use {{variable_name}} anywhere in the system_prompt or greeting to inject values at runtime. There are two layers:
  1. template_defaults: Default values set on the agent itself. These apply to every call unless overridden.
  2. arguments: Per-call overrides passed when dispatching a call.
In this example, patient_name resolves to “Maria” (from the call arguments) and practice_name resolves to “Greenfield Family Medicine” (from the agent defaults). The API response includes a template_variables field that lists every {{variable}} found in the prompt, along with whether it has a default value. This is useful for validating your templates before dispatching calls. Per-call arguments are limited to 32 keys, with keys up to 64 characters, values up to 1024 characters, and a combined value payload up to 8192 characters.

Runtime variables

Use runtime_variables when the model needs to capture call-scoped values during the conversation and reuse them later in tool configuration. These values:
  • exist only for the active call or web session
  • are set by the model through the built-in set_runtime_variables tool
  • can be referenced in webhook URLs and system tool template arguments using the same {{variable_name}} syntax

Next steps

Agent API examples

Create, test, update, and delete agents with code.

Dispatching calls

Outbound calls, template variables, and batch dispatch.