Draft a conversation flow with AI (streaming)
curl --request POST \
--url https://api.pineyard.ai/agents/studio/draft/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"goal": "<string>",
"companyName": "<string>",
"languages": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({goal: '<string>', companyName: '<string>', languages: ['<string>']})
};
fetch('https://api.pineyard.ai/agents/studio/draft/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/agents/studio/draft/stream"
payload = {
"goal": "<string>",
"companyName": "<string>",
"languages": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Agent studio
Draft a conversation flow with AI (streaming)
AI-draft over server-sent events — flow nodes/edges stream in as the model writes them
POST
/
agents
/
studio
/
draft
/
stream
Draft a conversation flow with AI (streaming)
curl --request POST \
--url https://api.pineyard.ai/agents/studio/draft/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"goal": "<string>",
"companyName": "<string>",
"languages": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({goal: '<string>', companyName: '<string>', languages: ['<string>']})
};
fetch('https://api.pineyard.ai/agents/studio/draft/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/agents/studio/draft/stream"
payload = {
"goal": "<string>",
"companyName": "<string>",
"languages": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Required scope:
agents.edit
Requires the
agent_studio feature enabled for your workspace. Otherwise the request is refused; see Errors.Authorizations
Your API key, e.g. pk_live_xxxxxxxxxxxxxxxxxxxxxxxx.
Body
application/json
Required string length:
1 - 2000Required string length:
1 - 120Required array length:
1 - 24 elementsRequired string length:
1 - 40Available options:
warm_professional, formal, casual, assertive, empathetic Maximum string length:
4000Maximum string length:
100Maximum string length:
100Maximum string length:
100Maximum string length:
8000Required string length:
1 - 40Minimum array length:
1Available options:
flow, faqs, opening Show child attributes
Show child attributes
Response
text/event-stream — data: lines of {type: node|edge|faqs|opening|keys|done|error, ...}; done carries the full StudioFlowDraftResponse payload

