Skip to main content
POST
Design an agent from a description
Describe the agent you want in plain language and get back the agent InstaView would build for you — the whole conversation, ready to create.
This does not create an agent. Nothing appears in your agent list, nothing can be called, and nothing is billable until you separately post the result to POST /agents. The 201 returned here created a composer session, not an agent.
That is the point of this endpoint: you can put “here is the agent I’d build for you” in front of a person, let them read it, change their mind twice, and only then create anything.

The shortest useful call

Two fields are required: your 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.
Everything else is optional and, if you send it, wins over what the composer chose — on this turn and on every later one. That is what name, language, duration, voiceId, backgroundSound, companyPhoneNumberId and metadata are for: pin the things you already know, and let the composer decide the rest.
You do not send a 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

Send another message to the session — “also ask about relocation”, “make it Slovak”.

Create it

Post the agent object, or just { "composerSessionId": "…" }.
The simplest way to create it is to hand back the session id and let us build exactly what you were shown:
Send fields alongside it to change your mind at the last moment — { "composerSessionId": "…", "name": "Backend Screen v2" } creates the previewed agent under a different name.
The conversation follows the agent. However you create it, the messages that designed it are attached to the new agent, so opening it in InstaView shows how it was built — and someone can carry on editing it there by hand.

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 a 429.

Errors

A 422 here means no session was created. Rephrase or add detail and call again.
Designing an agent takes a few seconds — it is a language-model call, not a database write, and a long brief takes longer than a short one. Allow up to two minutes on your client before you give up on the request; a short brief plus a couple of refinements is both quicker and easier to review than one page-long brief.

Authorizations

Authorization
string
header
required

API key for authentication using Bearer scheme

Query Parameters

companyId
string

Required for ATS API keys to specify which company to access. Ignored for standard company API keys.

Body

application/json
message
string
required

What the agent should do, in plain language. The composer designs the whole conversation from this.

Maximum string length: 8000
Example:

"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."

type
enum<string>
required

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.

Available options:
ONLINE,
PHONE
Example:

"PHONE"

name
string

Name for the agent. Optional — the composer proposes one from your brief. Anything you send here wins, and keeps winning on later turns.

Required string length: 3 - 100
Example:

"Senior Developer Phone Screen"

language
enum<string>

Language of the conversation. When omitted, the composer follows the language of your brief.

Available options:
EN,
SK,
CS
duration
number

Target call length in minutes.

Required range: 1 <= x <= 180
voiceId
string

Voice for the agent.

backgroundSound
enum<string>

Ambient background sound.

Available options:
OFFICE,
OFF
companyPhoneNumberId
string

The number this agent should call from. PHONE agents only.

metadata
object

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.

sessionId
string<uuid>
required

The session to send follow-up messages to, and to create the agent from.

agent
object
required

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.

message
object
required
expiresAt
string<date-time>
required

When this session is deleted if you never create the agent. Sessions live 30 days.