API reference
Automation building blocks
What you need to write an automation graph: the catalog of node types with their settings and outputs, the fields an event trigger can filter on, the prices of the media steps, and the automation builder assistant, which drafts or edits a graph from a description (a billed model call, answered asynchronously). 5 endpoints. Add your API key in the authentication panel to send test requests from this page.
Ask the automation builder assistant
/api/external/v1/automations/builder-assistantSends a request to the automation builder assistant - the editor's own - and answers at once (202) with a turn to follow with GET /automations/builder-assistant/{taskId} until it is COMPLETED or FAILED (most turns take 20 seconds to a few minutes; a turn is kept 30 minutes).
Body: message (required, up to 20000 characters: what to build or change, or a question; to answer the questions of an earlier turn, say the answers here and send that turn's graph), automationId (an automation of yours to work on: its saved graph is what it edits), graph (a graph to work on instead - e.g. the one an earlier turn proposed; *** keeps the secrets of the automation named by automationId), surgicalMode (true: the smallest change that does what is asked). With neither, it starts from a graph with one Manual Launch trigger.
Nothing is saved: the answer's graph is a proposal - save it with PUT /automations/{automationId} (or create one with it). The assistant does not see your flows, agents, tools and objects as it does in the editor: name them in the message (with their ids) when the graph should use them.
Billed as one turn of a building assistant, as in the app (only a turn that produced an answer is charged), and only on a plan that includes the building assistants. Errors: 400 MISSING_FIELD, FIELD_TOO_LONG, INVALID_ID, INVALID_GRAPH, MASKED_VALUE_UNKNOWN; 404 AUTOMATION_NOT_FOUND; 403 FORBIDDEN (the plan leaves the building assistants out, or the account cannot start new work); 402 PAYMENT_REQUIRED (not enough credits).
Request body application/json
object
Responses
200OK
Follow a builder assistant turn
/api/external/v1/automations/builder-assistant/{taskId}A turn of the automation builder assistant: taskId, status (PENDING, RUNNING, COMPLETED, FAILED), createdAt, startedAt, finishedAt, error (FAILED: why) and, once COMPLETED, answer: message (its reply), planStage (FINAL, or INTERMEDIATE when it built on assumptions and asks something), assumptions, questions, clarifyingQuestions ([{header, question, multiSelect, options: [{label, description, recommended}]}]), operations (what it changed: [{type, nodeId, description}]), graph (the proposed graph, secrets masked), readyToApply, validationIssues, validationWarnings, and error: true when it could not produce a graph (the message says why; such a turn is not charged).
Errors: 404 TASK_NOT_FOUND (not a turn of yours, or older than 30 minutes).
Parameters
taskIdstring (uuid)pathRequired
Responses
200OK
List the fields an event trigger can filter on
/api/external/v1/automations/event-fieldsThe fields an EVENT trigger's conditions can test, for one event (eventName, as in the catalog's eventPayloads, e.g. "New Call Analysis", "New Conversation Score", "Performance Alert"): groups, each {label, fields: [{path, label, type (string, number, boolean), hint}]} - the conversation's own fields, the score's or the alert's, and your account's own analysis results (the metric keys your conversations were actually analysed with over the last 180 days) and scorecard names.
Parameters
eventNamestringqueryThe event trigger's event name.
Responses
200OK
Read the media steps' prices
/api/external/v1/automations/media-pricingWhat the media and metered steps cost, in credits, as their charges are priced: seedanceSecond720p, seedanceSecond480p, minimaxSecond768p (a second of the platform's video), imageTokensPerMillion (the platform's pictures, per million image tokens), perAssetFee (by media type: what every other media item costs), browserMinute (a Browser Use step), decisionCall and decisionTokensPerMillion (a decision model step) and llmCall (a model call, at the platform's rate before any price your account was given).
Responses
200OK
Read the automation node catalog
/api/external/v1/automations/node-catalogEverything a graph is written from, as the editor and its assistant use it: graphShape (a node {id, type, label, x, y, width?, height?, data}, a connection {source, target, sourceHandle?, targetHandle?}, the graph's vars, varValues, promptFragments), nodes (each node type: type, typeLabel, description, category, defaultData, configSchema - its settings with valid examples - and outputSchema - what it hands on and how later steps read it), groups, triggerTypes, connectionHandles (the branch names of CONDITIONAL, SWITCH, loops, decision models and error paths), commonNodeData (settings every node has: error handling, pinned output, manual outputs, global variable writes), variableScopes and eventPayloads (every {{...}} path a step can read, per event trigger), structuralGuide (rules, canonical patterns and anti-patterns), executionStepTypes, and systemFunctions with systemFunctionCallNodeContract (the built-in functions a CALL_SYSTEM_FUNCTION step calls, with their parameters and an example of the step's data). The same for every account; cache it.
Responses
200OK