Skip to main content
POST
Draft a conversation flow with AI (streaming)
Required scope: agents.edit
Requires the agent_studio feature enabled for your workspace. Otherwise the request is refused; see Errors.

Authorizations

Authorization
string
header
required

Your API key, e.g. pk_live_xxxxxxxxxxxxxxxxxxxxxxxx.

Body

application/json
goal
string
required
Required string length: 1 - 2000
companyName
string
required
Required string length: 1 - 120
languages
string[]
required
Required array length: 1 - 24 elements
Required string length: 1 - 40
tone
enum<string>
required
Available options:
warm_professional,
formal,
casual,
assertive,
empathetic
companyDescription
string
Maximum string length: 4000
industry
string
Maximum string length: 100
designation
string
Maximum string length: 100
agentName
string
Maximum string length: 100
briefText
string
Maximum string length: 8000
primaryLanguage
string
Required string length: 1 - 40
parts
enum<string>[]
Minimum array length: 1
Available options:
flow,
faqs,
opening
revision
object

Response

text/event-stream — data: lines of {type: node|edge|faqs|opening|keys|done|error, ...}; done carries the full StudioFlowDraftResponse payload