Skip to main content
PUT
Save a flow on an agent

Authorizations

Authorization
string
header
required

Your workspace secret key, sk_live_ followed by 32 hex characters. Create one in the console under Developers.

Path Parameters

agent_id
string
required

The agent's id (agt_…).

Query Parameters

if_revision
string

Optional. The agent revision you read.

Body

application/json

A node graph: the conversation as nodes with their own instructions and transitions between them. See x-semantics.flow for the rules.

edges
object[]
required
Required array length: 1 - 40 elements
nodes
object[]
required
Required array length: 2 - 20 elements
viewport
any

Editor camera. Any JSON; stored and returned as sent.

Response

The agent, now node-based

behavior
object
required

How the agent takes turns with the caller. Always present; agents saved before this block existed read back with the defaults.

secondary_languages
enum<string>[]
required

Other languages callers may speak. Speech recognition listens for them as well as the primary language. Optional; the primary language is never repeated here. Always returned; [] when there are none.

Maximum array length: 4
Available options:
hi,
en,
gu,
mr,
bn,
ta,
te,
kn,
ml,
pa,
od
analysis
null | object

Replace the whole analysis block. Omit output_schema to remove structured extraction. Requires enabled=true to run.

archived
boolean
default:false

Archive to block new calls; false restores availability subject to draft validation. Accepted call snapshots remain unchanged.

background_sound
Available options:
off,
office
calls_from
null | object

The phone number this agent's outbound calls ring from when the call or its campaign does not choose one; null when unset (the Mirai shared line).

created_at
string<date-time>
draft
boolean
default:false

Drafts may have empty prompt or greeting, but cannot run calls.

emit_processed_webhook
boolean
default:true

Send call.processed when this agent has post-call tools, analysis or a flow (a flow agent's event carries the call's flow outcome). Set false to turn the event off.

emit_queued_webhook
boolean
default:false
end_call
object
first_message
string
Maximum string length: 500
flow
object

Present only on a flow agent.

id
string
input_schema
object | null

Replace the entire input declaration. Null removes it and restores legacy string variables.

language
string
Minimum string length: 1
max_duration_secs
integer
default:300
Required range: 30 <= x <= 1800
name
string
Minimum string length: 1
object
any
revision
integer
system_prompt
string
Maximum string length: 12000
tools
object[]

At most 40 tools: 10 pre_call, 20 on_call, 10 post_call. A PATCH replaces the whole list; null empties it. To edit one tool, use PUT/DELETE /v2/agents/{id}/tools/{name}.

Maximum array length: 40
updated_at
string<date-time>
voice
object
voicemail
object