Skip to main content
POST
Create agent
Create one unpublished agent draft with agents:create. Yappr assigns the agent ID, workflow ID/name, and execution ownership. Strict Mode starts off; the starter contains one conversation and a closing route, with empty Before and After phases. language defaults to he. Omit it and the agent is created to speak Hebrew, whatever language the request was written in — send "language": "en" explicitly for an English-speaking agent. language is the language the agent speaks and listens for on calls: one of the seventeen languages, or multi for an agent that answers in the caller’s language. The dashboard’s New Agent form asks for the same thing as Call language, and Agent settings shows and changes it afterwards. Those starting steps are written for a reader, not a caller: authoring_locale picks the language of their names, their instructions and the closing route condition (he or en), and defaults to he for a Hebrew agent and to en for any other. It never changes what the call is spoken in. So a body with no language at all comes back with Hebrew step names; {"language":"en"} gives English ones, and {"language":"he","authoring_locale":"en"} gives a Hebrew-speaking agent whose starting steps are written in English for the person editing them.
Nothing else is accepted. Creation settings, publication pointers and IDs are assigned by Yappr; configure ordinary agent settings after creation with PATCH /agents/{id} or GET /agents/{id}/settings.

Choosing a model

An agent runs on one of three models: gemini-3.1-flash-live, gemini-3.8-live or gpt-live. A new agent is automatic unless you say otherwise — Yappr picks by the agent’s language today (Hebrew and multilingual run gemini-3.1-flash-live, every other language gemini-3.8-live), and the response’s resolved_model tells you which. Send model to pin one of the two Gemini models from the first call, so the agent never moves:
A new agent starts on a Gemini voice, and gpt-live speaks only with its own voices, so it cannot be chosen in the create: model: "gpt-live" answers 400 WORKFLOW_AGENT_REQUEST_INVALID with an issues[] entry at /model that says how — create the agent, then PATCH /agents/{id} with model gpt-live and a voice of that model. model is saved with the agent in the same step, so it needs only agents:create.

The opening line

greeting_message is the one setting a create takes, so an agent can be made with its opening line in one request. It is the line the agent opens the call with when agent_speaks_first is true (the default), said word for word in the agent’s language — a voice of the second family (Keren, Eitan, … see Voices) can still put it in slightly different words. {{FirstName}} in it is filled in with the first name from the call’s variables or the lead’s stored name, and when there is none it is left out together with the space before it: "Hi {{FirstName}}, this is Dana from the clinic." opens as Hi Noa, this is Dana from the clinic. or Hi, this is Dana from the clinic. It is saved by the same settings write Update Agent makes, so the key needs agents:update as well as agents:create; without it the create answers 403 INSUFFICIENT_SCOPE and makes nothing. If the agent was made and the opening line could not be saved, the answer is 503 WORKFLOW_STORAGE_UNAVAILABLE: send the same request with the same Idempotency-Key and the retry saves it and returns the agent. greeting_message is not part of what the Idempotency-Key matches, because it is saved after the agent is made. A retry with the same key saves it only while the agent has no opening line and has not been changed since it was created — the case above, where the first answer was lost before the line was saved. Otherwise the retry answers 200 with the agent as it is, never 409, even when its greeting_message differs from the first request’s, and a line cleared later with PATCH stays cleared. Change the line with PATCH /agents/{id}.

Random variations

Any text the agent speaks or is instructed with can vary from call to call. Write two or more options between double braces with | between them, and the agent uses one of them:
  • Where it works. The opening line (greeting_message), a legacy agent’s system_prompt, a workflow’s global_instructions and every conversation step’s instructions, a flow agent’s node greetings, instructions, transfer and farewell lines, and a transfer tool’s announce_message. Inbound, outbound and browser calls alike, on every model.
  • One pick per call. Each group is picked when the call starts and stays the same for the whole call: the line the caller hears is the line the agent’s history shows, and the stored transcript shows what was actually said. The next call picks again.
  • As many as you like. Every group is its own pick, so {{Hi|Hello}} written twice can come out as Hi … Hello. Agent eval runs pick the same way.
  • Options are plain text, used exactly as written — spaces included and nothing trimmed. An option may be empty: {{Sure, |}}let me check says Sure, let me check or let me check. An option cannot hold a brace: {{Hi {there}|Hello}} is not a choice, it is read out braces and all, and the dashboard flags it.
  • Variables sit next to a group, never inside it. {{Hi|Hello}} {{FirstName}} works; {{Hi {{FirstName}}|Hello}} is not a choice and the dashboard flags it. Groups are picked before variables are filled in, so a variable’s value is never read as a choice.
  • Nothing that already used braces changes meaning. A group without | is a variable ({{FirstName}}, {{CurrentDateTime.Asia/Jerusalem}}), and a workflow reference keeps its fallback: {{call.caller_number|the caller}} and {{before.step_id.field|text}} are references, not choices. A variable has no fallback of its own: {{FirstName|there}} is a choice between the words FirstName and there — write {{FirstName}}, which is left out of a spoken line when the call has no value for it.

Start from a template

Send template instead of your own instructions and the agent starts with the same instructions the dashboard’s New agent form offers:
The starter is written in authoring_locale, which defaults to he for a Hebrew agent and en for any other: language en (or fr, or multi) alone gives the English starter, and so does authoring_locale en; when both are sent, authoring_locale decides. It is the text the dashboard shows a reader in that language, and ordinary instructions: read it with GET /agents/{id}/workflow and change it with PUT /agents/{id}/workflow. A body with both template and non-empty workflow.global_instructions is 400 WORKFLOW_AGENT_REQUEST_INVALID, and so is a template outside the three names. The name does not say which way the agent calls: that is the number’s job (next section).

Numbers carry the direction, not agents

An agent has no inbound or outbound setting; the same agent can answer calls and place them. A number decides which:
  • To answer calls, set the agent as a phone number’s inbound_agent_id (PATCH /phone-numbers/{id}) or a SIP address endpoint’s (POST /sip-endpoints). A username-and-password trunk can answer for them too, once the workflow is published. inbound on GET /agents lists what routes calls to it.
  • To place calls, send its agent_id to POST /calls with a from number, or set it as the number’s outbound_agent_id so a call from that number without an agent_id uses it. A number from your own Telnyx account is outbound only.
  • No number yet? A browser call (POST /calls with type: "web", the dashboard’s Test Call) reaches the agent without one.
Names are not unique. A POST /agents with a name another agent already has makes a second agent under that name, answered 201 like the first. Only the Idempotency-Key makes a retry return the agent it already made. To see whether a name is in use, GET /agents?name= lists every agent whose name contains it; tell same-named agents apart by id and created_at. The response is 201 and the full agent object — the same twenty-seven fields List agents returns for a workflow_v1 row, plus the idempotency_key you sent:
idempotency_key is the Idempotency-Key you sent, echoed back so the response confirms which key produced this agent — and, on a replay, that the same key produced the same one. It is on the two responses that create an agent, this one and Duplicate agent, and nowhere else: the key belongs to the request, not to the agent, so a read of the agent carries no key at all. type is "workflow", and on an agent created here the legacy slots are absent rather than empty: there is no system_prompt, flow_config, webhook_url, webhook_events, webhook_headers or tools key to read. (Agents from before the workflow engine still carry all six — see List agents.) published_workflow_revision_id is null because creation never publishes, and the workflow itself is not included — read it with GET /agents/{id}/workflow. Read the canonical draft with GET /agents/{id}/workflow. Save with PUT /agents/{id}/workflow using its current expected_version and document, then validate or publish with POST /agents/{id}/workflow/validate or /publish and {"expected_version":1} (use the current saved version). Creation never publishes. Publication does not by itself enable calling or the legacy call tester. Retry a lost response with the same key and accepted body: the original agent returns with HTTP 200. A changed name, description, language, authoring_locale, model or instructions (workflow.global_instructions, or the text a template writes) returns 409 AGENT_IDEMPOTENCY_CONFLICT; greeting_message is not compared (The opening line). A disabled agent is returned unchanged; an archived or removed original returns 410 AGENT_CREATION_GONE and is never recreated. Keys are scoped to the company and this creation endpoint.

There is one kind of agent

A create body carrying system_prompt, type, flow_config, tools, tool_ids, prompt, webhook_url, webhook_events or webhook_headers asks for the prompt or flow agent this API used to create. That is gone, and the request answers:
with HTTP 410, because the request is well formed and the kind of agent it asks for no longer exists. 400 would suggest a field to fix; there isn’t one. This is decided by what the body asks for, never by what it leaves out. A body that simply forgot something — {}, or a name with no workflow — is 400 WORKFLOW_AGENT_REQUEST_INVALID. Every problem in the body is named in the one answer: issues[] has an entry per field at fault — code (field_unknown, field_required or field_invalid), path (/name, /language, /workflow/global_instructions, …) and message — and error repeats the first. {"language":"xx","colour":"red"} names /colour, /name, /language and /workflow/global_instructions together, not one per round trip:
The body is checked before the Idempotency-Key header, so a request that is wrong in both places is told about the part it wrote first. Nothing you already have stops working. Every agent that existed before this release was converted onto the workflow engine: it keeps taking calls, keeps its tools, its lifecycle webhooks and its phone numbers, and is still read with GET /agents/{id}, updated with PATCH /agents/{id} and archived with DELETE /agents/{id}. Only creating another one this way is gone. If you are moving an integration off the old body: send name and workflow.global_instructions in place of name and system_prompt, then add what the old body carried through its own endpoint — tools with POST /tools and the workflow’s bindings, the conversation graph with PUT /agents/{id}/workflow instead of flow_config, and lifecycle webhooks as a follow-up: an http tool from POST /tools, bound to a step under after in that same save (see Follow-up triggers). A workflow agent has no webhook_url, so PATCH /agents/{id} refuses one and names it.

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Headers

Idempotency-Key
string
required

Scoped to this company and creation endpoint. The same normalized accepted body returns the original agent with 200; a changed body returns 409. Retry a lost response with the same key. An archived or removed original returns 410 AGENT_CREATION_GONE without recreating it; a merely disabled original returns 200 unchanged.

Pattern: ^[A-Za-z0-9_-]{16,128}$

Body

application/json

Send workflow or template.

name
string
required
Required string length: 1 - 200
Example:

"Reception assistant"

description
string | null
Maximum string length: 2000
language
enum<string>
default:he

The language the agent speaks and listens for on calls, or multi for a multilingual agent that answers in the caller's language (see the Languages page). he-IL and iw are read as he, en-US and en-GB as en, as PATCH /agents/{id} reads them; the agent stores and answers the short form. An en agent opens and talks in English, from its first word; a he agent in Hebrew; an fr agent in French. The dashboard's Call language (New Agent, Agent settings) is the same field.

Available options:
he,
en,
ar,
ru,
fr,
es,
de,
it,
pt,
nl,
tr,
pl,
uk,
hi,
ja,
ko,
zh,
multi,
he-IL,
iw,
en-US,
en-GB
greeting_message
string | null

The opening line, said word for word when the agent speaks first (a second-family voice can still word it slightly differently), with {{FirstName}} filled in from the call's variables or the lead's name, or left out with the space before it. Saved the way PATCH /agents/{id} saves it, so the key needs agents:update as well as agents:create; null or omitted leaves the agent without one. It is not part of what the Idempotency-Key matches: a replay with the same key saves it only while the agent has no opening line and is unchanged since it was created (the first answer was lost before the line was saved), and otherwise answers 200 with the agent as it is, never 409, even when this line differs from the first request's. Random variations: {{Hi|Hello|Hey}} (two or more options separated by |) says one option, picked once per call; see Random variations.

model
enum<string> | null

The voice model the new agent runs on. Omit it or send null for automatic: Yappr picks by the agent's language. gpt-live is not accepted here, because it needs one of its own voices and a new agent starts on a Gemini voice: create the agent, then send model gpt-live with a voice to PATCH /agents/{id}. Part of what the Idempotency-Key matches when sent; a request without it matches one made before models could be chosen.

Available options:
gemini-3.1-flash-live,
gemini-3.8-live
authoring_locale
enum<string>

The language Yappr writes the starting step names, their instructions and the closing route condition in. Nobody speaks these; they are read by whoever opens the workflow. Defaults to he for a Hebrew agent and en for any other language (multi included). Sending it does not change what the call is spoken in.

Available options:
he,
en
template
enum<string>

Start from one of the dashboard's starters: inbound answers incoming calls, qualify calls a lead back, reminder confirms a booked appointment. Yappr writes the starter's text into workflow.global_instructions, in authoring_locale. Takes the place of workflow; sending both with non-empty instructions is refused.

Available options:
inbound,
qualify,
reminder
workflow
object

Response

Idempotent replay; the original agent is returned without reactivation.

id
string<uuid>
name
string
execution_version
enum<string>
read-only

Authoring ownership assigned by Yappr. workflow_v1 can be an unpublished draft; this field does not prove call readiness.

Available options:
legacy,
workflow_v1
published_workflow_revision_id
string<uuid> | null
read-only

Null until explicit workflow publication. Cannot be set by agent create or PATCH.

live
boolean
read-only

On GET /agents and GET /agents/{id}: whether callers reach this agent right now. A workflow_v1 agent is live when it is active and a version of its workflow is published; a saved draft that was never published is not live. A legacy agent (type prompt or flow) has nothing to publish and is live whenever it is active, with published_workflow_revision_id null. A deactivated agent is never live. For a workflow_v1 agent the dashboard's "Live · version N" badge is the same fact; N is published.version on GET /agents/{id}/workflow.

inbound
object
read-only

On GET /agents and GET /agents/{id}: what routes inbound calls to this agent - active phone numbers that answer with it (as the number's agent or the other half of its A/B split) and active SIP endpoints. Empty lists mean no inbound route reaches it; the member is absent when the routes could not be read. A key reads each route as its scopes allow: without phone_numbers:search a number's number and friendly_name are null, and without sip_endpoints:read an endpoint's name is null.

type
enum<string>

workflow on every agent with execution_version: workflow_v1 — the only kind that can be created. Such an agent also omits system_prompt, flow_config, webhook_url, webhook_events, webhook_headers and tools: it has no such things, and returning them as nulls read as the retired kind. Its instructions, graph and tool bindings are its workflow document — GET /agents/{id}/workflow. prompt and flow appear only on agents created before the workflow engine, which keep their old response shape unchanged. prompt (legacy): a single system_prompt drives the call; the LLM decides when to call attached tools. flow: the call is driven by a flow_config graph. type is immutable post-create.

Available options:
workflow,
prompt,
flow
flow_config
object | null

Legacy agents only, and absent from a workflow agent's response. The flow graph. Required when type='flow', must be omitted/null when type='prompt'.

system_prompt
string | null

Legacy agents only, and absent from a workflow agent's response — read its workflow document instead. {{VariableName}} is filled in from the call's variables. Random variations: {{Hi|Hello|Hey}} (two or more options separated by |) says one option, picked once per call; see Random variations.

description
string | null
voice
enum<string>

The persona the agent speaks in. A voice belongs to one of Yappr's two voice families, so naming a voice on its own still chooses the family — and with it the model family (model below) — and no existing client has to change. There is no separate engine field, and engine / engine_voice are rejected if you send them. Keren, Eitan, Hila, Ido, Boaz, Tali, Erez, Efrat are the voices of gpt-live, available to every workspace. Agents on these voices handle their own turn-taking and expressiveness, so temperature, vad_stop_secs, vad_start_secs and vad_confidence are rejected on them, and they cannot be used on a type='flow' agent. The other thirty are the voices of both Gemini models. Any other name returns 400 listing every voice you may use. Always the name the agent actually speaks in, whichever family it is on.

Available options:
Michal,
Yonatan,
David,
Rachel,
Gil,
Noa,
Maya,
Adam,
Shira,
Avigail,
Amir,
Liat,
Omer,
Tamar,
Tom,
Benny,
Nir,
Natan,
Yael,
Dvora,
Yosef,
Shir,
Anat,
Ariel,
Roi,
Shlomo,
Dana,
Alon,
Ruth,
Yuval,
Keren,
Eitan,
Hila,
Ido,
Boaz,
Tali,
Erez,
Efrat
model
enum<string> | null

The voice model the agent runs on, as you chose it; null means automatic, where Yappr picks by the agent's language (see resolved_model). See the models page for what each model is and how to choose. A gpt-live agent always reads gpt-live: GPT Live is chosen through its voices, never automatically.

Available options:
gemini-3.1-flash-live,
gemini-3.8-live,
gpt-live
resolved_model
enum<string>
read-only

The model the agent's calls run on: model when it is set, and otherwise what automatic chooses today for the agent's language (Hebrew and multilingual run gemini-3.1-flash-live, every other language gemini-3.8-live). Read-only, and it can change for an automatic agent when Yappr moves a language to a better model; a pinned model never moves.

Available options:
gemini-3.1-flash-live,
gemini-3.8-live,
gpt-live
background_sound
enum<string> | null

Ambient background sound mixed under the agent's voice during calls. Null means silent (default).

Available options:
call_center,
open_office,
cafe,
outdoor
background_sound_volume
number
default:0.3

Volume of the background sound, 0.0–0.6. Capped to protect turn-taking.

Required range: 0 <= x <= 0.6
language
enum<string>

The language the agent speaks and listens for on calls, as its short code, or multi for a multilingual agent that answers in the caller's language and switches when they do. Each language gets its own speaking rules (politeness, gender, how numbers, dates and prices are said). See the Languages page.

Available options:
he,
en,
ar,
ru,
fr,
es,
de,
it,
pt,
nl,
tr,
pl,
uk,
hi,
ja,
ko,
zh,
multi
temperature
number

How varied the agent's wording is. On the Gemini voices a value below 0.3 is stored and returned as you sent it, and the agent speaks as if it were 0.3: lower values sometimes made a call open on a word or two and a pause. The expressive voices do not take it.

Required range: 0 <= x <= 2
greeting_message
string | null

The line the agent opens the call with when agent_speaks_first is true, said word for word in the agent's language (a second-family voice can still word it slightly differently). On the standard voices a caller's brief hello in the first few seconds of the line does not interrupt it; a caller who keeps talking over it does. {{FirstName}} is filled in from the call's variables or the lead's name, or left out with the space before it when there is none. Send null to clear it and let the agent open in its own words. Editable here and on PATCH /agents/{id}; on a flow agent the start node's own opening overrides it. Random variations: {{Hi|Hello|Hey}} (two or more options separated by |) says one option, picked once per call; see Random variations. On a workflow agent it may read a Before-call step's result, {{before.<step_id>.|}}, said word for word: the value, else the fallback, else the rest of the line; Check and Publish refuse a step the workflow does not have. See Opening line from a Before step.

agent_speaks_first
boolean
vad_stop_secs
number
default:0.5

Seconds of silence that end the caller's turn. Lower answers sooner and cuts a caller who pauses mid-thought; higher waits longer before replying. Below 0.5 s the agent may start answering half a sentence.

Required range: 0.05 <= x <= 5
vad_start_secs
number
default:0.2

Seconds of speech that count as the caller starting to talk. It also sets how much of the moment before that is kept, so an interruption does not lose the caller's first word.

Required range: 0.05 <= x <= 2
vad_confidence
number
default:0.7

How sure the agent must be that it is hearing speech. Below the 0.7 default the agent reacts more eagerly — useful for quiet callers, and more likely to react to background noise on a noisy line. Two things read it, and they read it differently. How readily the caller can cut the agent off mid-sentence follows the number continuously, so any change moves it. Where the caller's turn begins and ends is a two-position switch either side of the 0.7 default: at or above it the agent is deliberate about deciding the caller has started or stopped, below it eager. For that half, 0.05 and 0.69 behave identically, and so do 0.70 and 1.00 — tune it by moving across the default, not by nudging it.

Required range: 0 <= x <= 1
silence_timeout_secs
number
default:60

Seconds of caller silence before auto-hangup. Prevents idle calls wasting credits.

Required range: 10 <= x <= 900
idle_reminder_count
integer
default:0

How many times the agent asks a silent caller whether they are still there before silence_timeout_secs hangs up. Each reminder is said when the silence timeout runs out, and the timer starts again after it; the caller speaking resets the count. 0 (the default) hangs up at the first timeout without asking. See Idle reminders.

Required range: 0 <= x <= 3
idle_reminder_text
string | null

What the agent says as each reminder, word for word. Null (the default) is a short line in the call's language ("Hello, are you still there?" in English); for a language without a fixed line, the agent asks in its own words in the call's language. A blank string is stored as null.

Maximum string length: 200
max_continuous_speech_secs
number
default:120

Max seconds one party can speak non-stop before auto-hangup. Catches answering machines. 0 = disabled.

Required range: 0 <= x <= 300
max_call_duration_secs
number
default:600

Hard cap on total call duration regardless of activity. 0 = no cap of the agent's own; the platform still ends the call after 65 minutes (3900 s), with the disconnect reason Platform call limit reached. A call is never billed for more than this plus 60 seconds; with 0, or once a call is transferred to a person, billing stops at 4 hours.

Required range: 0 <= x <= 3600
lead_memory_enabled
boolean
default:true

When true, the matched lead's long-term memory context is injected into the system prompt at call time.

noise_cancellation_enabled
boolean
is_active
boolean
webhook_url
string<uri> | null

Legacy agents only. Read whole by a key with tools:read (or tools:update), the rule GET /deliveries/{id} applies to the same destination; for any other key, and in a campaign or eval-case embed, it is scheme://host[:port] and webhook_url_path_withheld is true. Send the whole URL to change it.

webhook_url_path_withheld
boolean
read-only

Legacy agents only. True when webhook_url is shortened to scheme://host[:port] because the reading key holds neither tools:read nor tools:update.

webhook_events
enum<string>[]

Events posted to webhook_url as {event, timestamp, agent_id, company_id, call_id, data}. data on every call event carries direction, status, from_number, to_number, duration_seconds, started_at (when the call was placed), answered_at (when its audio came up; absent until it did) and recording_started_at (when its recording began - a transcript's start and end are milliseconds from here; null until the recording is saved, on a browser call, and on older calls recorded before the field was added), all ISO 8601 with a +00:00 offset as GET /calls/{id} writes them; plus disposition, summary, transcript and extracted_data once they exist. transcript.ready and call.analyzed are sent after the recording is saved, so they carry recording_started_at on a phone call. No event carries the conversation while the call is still going. call.failed and call.no_answer carry data.hangup_cause when the cause is known. For a call from a number in your own Telnyx account that Telnyx refused while it rang, call.failed has data.hangup_cause:

  • carrier_rejected — Telnyx refused the call (SIP 401, 403 or 407).
  • carrier_number_invalid — Telnyx could not route the number called (SIP 404, 484 or 604).

The SIP code is not in the webhook; the carrier account keeps the last one in last_error.sip_code. One Telnyx refused before it rang sends no webhook when POST /calls was placing it (the request answers 422); from the queue it sends call.failed with data.error_reason instead.

Available options:
call.started,
call.answered,
call.ended,
call.failed,
call.no_answer,
call.dnc_blocked,
transcript.ready,
call.analyzed
configured_webhook_header_names
string[]
read-only

Legacy agents only, and absent from a workflow agent's response. The names of the stored webhook_headers, sorted; the values are never returned, to any key.

Example:
tools
object[]
read-only

Legacy agents only, and absent from a workflow agent's response. The agent's tools in execution order, each as GET /tools/{id} answers it plus execution_order, for a key that holds tools:read; without it each is {id, name} only.

extraction_parameters
object[]

AI extraction parameters — after each call, values are extracted from the transcript, stored on the call log and included in the call.analyzed webhook payload. Read them back on a call as extracted_data in GET /calls/{id}.

created_at
string<date-time>
updated_at
string<date-time>