Skip to main content
POST
Create or replace a conversation route

Authorizations

x-api-key
string
header
required

Path Parameters

route_name
string
required

Body

application/json

The client-facing create/edit body for a conversation route: the fields a caller supplies.

Binds a (target_kind, target_name) — an agent run or a tool dispatch — to an execution_key the turn runs AS (bound with pass-role at create). A tool target may carry a payload_expr (jq mapping the inbound message to the tool's kwargs) and a reply_expr (jq mapping the tool's result to the reply); both are tool-only. api rows MAY carry an https callback_url (the answer sink; when absent the caller reads its answer back from the poll door); channel rows carry the registry channel plus the our_identity the medium is texted at (N rows may share a channel, each its own identity). The server-derived callback_secret and execution_key_fingerprint are deliberately absent; :class:ConversationRoute is this shape plus those. Frozen.

door
enum<string>
required
Available options:
api,
channel
execution_key
string
required

The api-key user_id the turn runs AS; its live stored grants authorize the agent run or tool dispatch and every tool call the turn makes.

Minimum string length: 1
route_name
string
required
target_kind
enum<string>
required
Available options:
agent,
tool
target_name
string
required
Minimum string length: 1
callback_url
string | null
channel
string | null
error_reply_text
string | null
Required string length: 1 - 2000
initial_mode
enum<string>
default:agent
Available options:
agent,
manual
locale
string | null
our_identity
string | null
payload_expr
TemplatedText · object | null

A renderable text: its source plus the parameters its render takes.

EXACTLY ONE source is set — content (the text inline) or id (the id of a stored resource holding the text); neither and both are refused at construction. kwargs are the render parameters for the TEXT and apply either way, so moving a text from inline to stored (or back) leaves its parameters untouched.

reply_expr
TemplatedText · object | null

A renderable text: its source plus the parameters its render takes.

EXACTLY ONE source is set — content (the text inline) or id (the id of a stored resource holding the text); neither and both are refused at construction. kwargs are the render parameters for the TEXT and apply either way, so moving a text from inline to stored (or back) leaves its parameters untouched.

turns_per_hour_override
integer | null
Required range: x > 0

Response

Success.

data
ConversationRouteCreateResult · object
required

The created/replaced route. callback_secret is the api-door callback signing secret surfaced ONCE (null for a channel route); route is the stored view with its secret stripped.