Design an Agent
Designs a complete custom agent from a plain-language brief and returns it as a preview, together with a session you can keep refining. No agent is created. Nothing appears in your agent list until you post the returned agent (or { "composerSessionId": … }) to POST /agents — the 201 here created a session, not an agent.
The shortest useful call
message, and the type of agent to design.
type is required and cannot change later. The channel decides which conversation
steps are legal at all — a transfer to a person exists only on PHONE — so it has to be
known before the agent is designed rather than guessed from your brief.name, language, duration, voiceId, backgroundSound, companyPhoneNumberId and metadata are for: pin the things you already know, and let the composer decide the rest.
flow. flow, focus, guardrails, contextConfig and
analyticsConfig are what the composer writes for you, and sending any of them is
rejected with a 422 naming which. If you already have a flow, you do not need the
composer — post it straight to POST /agents.The accompanying message
message.content is a plain-language description of the agent, in at most ten sentences: what it opens with, what it asks about, what it decides, and how it ends. It is written for a person, not for a parser — it is the text to show next to a “create this agent” button.
message.changes is a short list of labels for what the composer did. On the first turn it describes what it built; on later turns, what changed.
What to do with the preview
agent is a body POST /agents accepts verbatim — no ids, no schemaVersion, and a conditional’s fallthrough already named by defaultBranch. Nothing to strip, nothing to fix up.
Change something first
Create it
agent object, or just { "composerSessionId": "…" }.{ "composerSessionId": "…", "name": "Backend Screen v2" } creates the previewed agent under a different name.
Sessions expire
A session lives 30 days. After that, a preview nobody accepted is deleted along with its conversation;expiresAt on every response tells you when. Creating the agent ends the clock — a session that became an agent is kept.
Rate limits
Every call here designs an agent with a language model, so these routes carry their own limit on top of your key’s usual allowance: 6 per minute and 60 per hour for this endpoint, 10 per minute and 120 per hour for refining. Exceeding it is a429.
Errors
422 here means no session was created. Rephrase or add detail and call again.
Authorizations
API key for authentication using Bearer scheme
Query Parameters
Required for ATS API keys to specify which company to access. Ignored for standard company API keys.
Body
What the agent should do, in plain language. The composer designs the whole conversation from this.
8000"Screen senior backend devs. Ask about Go and Postgres, check notice period and salary expectation, then hand off to a recruiter if they're a strong fit."
The channel the agent will run on. Required, and fixed for the life of the session: it decides which conversation steps are available at all — a transfer to a person exists only on PHONE.
ONLINE, PHONE "PHONE"
Name for the agent. Optional — the composer proposes one from your brief. Anything you send here wins, and keeps winning on later turns.
3 - 100"Senior Developer Phone Screen"
Language of the conversation. When omitted, the composer follows the language of your brief.
EN, SK, CS Target call length in minutes.
1 <= x <= 180Voice for the agent.
Ambient background sound.
OFFICE, OFF The number this agent should call from. PHONE agents only.
Custom metadata carried through to the agent you create from this session.
Response
The composer session, the agent it would create, and the composer's reply.
The session to send follow-up messages to, and to create the agent from.
The agent the composer would build. There is no id: this agent does not exist yet. Post this object to POST /agents to create it — it is accepted verbatim, with no ids or schemaVersion to strip first.
When this session is deleted if you never create the agent. Sessions live 30 days.