Publish
/api/v1/ai-agents/{id}/publishPublishes the current draft as a new live version. This affects real customers: new conversations get the new version right away, while conversations already in progress keep their version until they have been inactive for inactivityTimeout seconds.
Every publish is kept in List Versions. Takes about 4 seconds.
Request
Authorization
Bearer Token
Provide your API token in the Authorization header. See Authentication to issue one.
Example:Authorization: Bearer ********************
idstringrequiredAI agent ID.
Example:6ad97ee52845b4f2c8daca55
versionstringrequiredLabel for this version, 1-100 characters, e.g.
v3 - pricing FAQ.
Responses
200The agent, with live now pointing at the new version.
The agent, with live now pointing at the new version.
requestIdstringrequiredUnique ID for this request. Quote it when reporting a problem.
dataobjectrequiredChild attributes
idstringrequiredAI agent ID. Use it in every
/ai-agents/{id}path.namestringrequiredinactivityTimeoutintegerrequiredSeconds of customer silence before the conversation session expires and the next message starts fresh.
hasDraftbooleanrequiredTrue once a draft flow has been saved.
hasLivebooleanrequiredTrue once a flow has been published. Only live agents answer customers.
draftobject | nulloptionalThe working copy. Null until a flow is saved.
Child attributes
idstringoptionalDraft flow ID.
modelstringoptionalsavedAtstring | nulloptionalWhen the draft was last saved (ISO 8601).
liveobject | nulloptionalThe published version customers talk to. Null until the first publish.
Child attributes
idstringoptionalLive flow version ID.
versionstringoptionalLabel given when it was published.
modelstringoptionalpublishedAtstring | nulloptionalISO 8601.
400Invalid body or parameters, e.g. an empty name, an unknown node type or a malformed ID.
Invalid body or parameters, e.g. an empty name, an unknown node type or a malformed ID.
messagestringrequired
401API key missing, invalid, revoked or expired.
API key missing, invalid, revoked or expired.
messagestringrequired
404No AI agent with this ID in your workspace.
No AI agent with this ID in your workspace.
messagestringrequired
409The agent has no draft flow. Save one with Update Flow first.
The agent has no draft flow. Save one with Update Flow first.
messagestringrequired
422The draft flow is invalid; problems lists why.
The draft flow is invalid; problems lists why.
messagestringrequired
429Rate limit reached. Retry after a short pause.
Rate limit reached. Retry after a short pause.
messagestringrequired
502The AI agent service is temporarily unavailable. Retry shortly.
The AI agent service is temporarily unavailable. Retry shortly.
messagestringrequired