Skip to main content
This guide takes you from a new voice agent to one that greets callers, follows your instructions and sounds the way you want. Create the agent with one request, then adjust it through the settings endpoints.

Create the agent

POST /api/v1/voice_agents needs only a name. Set the instructions, the greeting and the language in the same request so the agent is usable right away:
The voice_config block is optional and takes the same keys and values as the settings below. Every value is validated as if you had set it with the settings endpoints; if one is rejected, nothing is created and the API returns 422. Keep the returned id - all settings and tools use it. Afterwards:
  • Add tools with POST /api/v2/tools, using the agent’s id as agent_id. See Tools.
  • Connect a phone number in the dashboard. See AI numbers.

What you configure where

A voice agent has three settings groups. Each has a read, an update and a schema endpoint under /api/v1/voice_agents/{id}/concerns/<group>. If you only want an agent that answers calls with your instructions, you need the prompts group. The defaults in voice_config work without changes.

How a change works

  1. Read the schema - GET .../concerns/<group>/schema. It lists every setting (fields[].key), its type (value_type), its limits (validation) and, for selection fields, the accepted values (option_sets[field.options_ref]).
  2. Write one setting - PATCH .../concerns/<group> with { "key": "<fields[].key>", "value": <value> }. One setting per request.
  3. Check effects - the response lists every related setting the server changed along with yours, with the old and the new value. values is the resulting configuration.
Read the schema again after changing a field marked affects_schema: true (conversation type, language model, speech model, voice): the options of related fields change with it.
Labels and option descriptions in the schema are localized. Add ?locale=en (or de, es) to choose the language; the response states it in the Content-Language header. Always send an option’s value, never its label.

Recipes

Each recipe changes one setting of an existing agent. Agent 789 in the examples; responses are shortened.

Set the greeting

The greeting is the first sentence the agent says when it picks up, up to 1000 characters. %%caller_number%%, %%called_number%% and %%forwarded_from_number%% are replaced with the live call’s numbers.

Change the instructions and the language

prompts.user_prompt holds the instructions: the agent’s role, what it should find out and how it should answer. The prompting guide explains how to write them.
prompts.transcription_locale is the language the agent listens in: de, en, fr and so on, or xx when callers may speak different languages. The full list is in option_sets["prompts.transcription_locales"].

Pick a voice

Voices are listed in option_sets["voice_config.tts_voices"], each with a label, provider, gender and a short description:
Send the value exactly as listed:
The speech model follows the voice: a voice from another provider also switches voice_config.tts to that provider’s model, and effects shows it. To use a different model of the same provider (for example ElevenLabs Flash instead of v3 Conversational), set voice_config.tts afterwards; the voice is kept. Choosing a model of another provider resets the voice to that provider’s default.

Choose the language model

The language model writes the agent’s answers. Pick a value from option_sets["voice_config.llm_models"]:
voice_config.response_style (0 to 1) controls how varied the answers are: lower is more predictable, higher is more creative.

Switch the conversation type

voice_config.model_mode decides how the agent processes speech:
Switching the conversation type resets the language model, speech models, voice and response time to the defaults of the new type, and replaces the global behavior rules (prompts.system_prompt) with that type’s default. Switch first, then read the schema again and apply your own choices.

Tune response time and call limits

voice_config.response_time_ms is how long the agent waits after the caller stops speaking before it answers. The field’s presets are 0 (fast), 700 (balanced) and 1200 (patient).
The timeouts and the maximum call duration take seconds, with -1 for “off” (the field’s validation.disabled_value). Any other value must be at least validation.min. To end calls after ten minutes:

Settings reference

The schema decides what an agent accepts right now. These tables explain what each setting does.

Prompt settings (prompts)

option_sets["prompts.variable_suggestions"] lists the variables, such as %%caller_number%%, you can use in the instructions.

Voice settings (voice_config)

Fields you cannot write

A field whose capabilities.writable is false is rejected on write. capabilities.reason says why:

Concurrent edits: If-Match

Every read and write returns a revision. Send it as the If-Match header on a PATCH. If the configuration changed since that read, for example in the dashboard, nothing is saved and the API returns 409 with the current revision and values. If-Match is optional; without it the write always applies.

Rejected values

A value the schema does not allow returns 422, with errors keyed by field. values and revision show the unchanged state:
When a selection value is rejected, read the schema again: the options usually changed because of an earlier change.