Flow AssistantBeta
Ask questions about your automations, and create or change them by describing what you want.
These routes are not yet in the stable release. The base URL and paths are provisional and may change without notice. Do not build critical production flows on them yet.
The Flow Assistant works on your automations through plain language:
- Ask: "Which blocks open a ticket?" The assistant reads your automations and answers, pointing to the blocks it used. It changes nothing.
- Create: describe the service you want ("handle delivery questions, bookings and complaints") and get a complete automation with its blocks.
- Edit: give an instruction ("add a block for complaints") and get the changed automation, with a list of what was added, changed or removed.
- Versions and rollback: every change saves a version, so you can go back.
Create and edit work in two steps if you want to review first: a preview returns the proposal without saving, and apply saves it. A preview is kept for 10 minutes. There is also a one-step route that previews and applies at once.
ReferenceTechnical details
Base path: /api/externalAPIs/public/tolkyReasoning/decisions/assistant
Authentication: host token, or domain token with hostId of an account in your domain. avatarId, when sent, must belong to that account.
| Route | Method | Body | Does |
|---|---|---|---|
/ask | POST | hostId, question, avatarId (optional) | Answers a question. Read only. Up to 90 seconds. |
/create/preview | POST | hostId, prompt, avatarId, decisionName, agents (last three optional) | Proposes a new automation without saving. |
/create/apply | POST | hostId, previewId or proposedChain, avatarId, userId, active | Saves a proposed automation. active defaults to true. |
/create | POST | Same as /create/preview | Proposes and saves in one call. |
/edit/preview | POST | hostId, decisionChainId, instruction, avatarId (optional) | Proposes a change without saving. |
/edit/apply | POST | hostId, decisionChainId, previewId or proposedChainJson, userId | Saves a proposed change. |
/edit | POST | Same as /edit/preview | Proposes and saves in one call. |
/versions | GET | Query: decisionChainId, limit (default 20), offset (default 0) | Lists versions of an automation. |
/rollback | POST | hostId, decisionChainId, versionId, userId | Restores a version. The current state is saved as a new version first. |
previewId and proposedChain (or proposedChainJson) are mutually exclusive: send one of them. Without avatarId, a new automation applies to all avatars of the account. Without agents, the assistant uses the agents available to your account. Routes other than /ask allow up to 60 seconds.
curl -X POST "https://api.tolky.to/api/externalAPIs/public/tolkyReasoning/decisions/assistant/edit/preview" \
-H "Authorization: Bearer $TOLKY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"hostId": "<your-host-id>",
"decisionChainId": "5b9e2d7c-...",
"instruction": "Add a block that handles customer complaints and opens a ticket."
}'{
"code": 200,
"message": "OK",
"data": {
"previewId": "e1f2a3b4-...",
"currentChainJson": ["..."],
"proposedChainJson": ["..."],
"diff": { "added": [{ "blockIndex": 3, "block": { "type": "complaints" } }], "modified": [], "removed": [] },
"explanation": "Added a complaints block that opens a ticket.",
"expiresAt": "2026-11-16T14:10:00.000Z"
}
}Main response fields:
| Route | Fields |
|---|---|
/ask | answer, referencedBlocks (automation, block type and index), confidence (high, medium, low). |
/create/preview | previewId, proposedChain (decisionName, instructions, chainJson), summary, explanation, expiresAt. |
/create/apply, /create | success, decisionChainId, decisionName, versionId, versionNumber, chainJson, active. |
/edit/preview | previewId, currentChainJson, proposedChainJson, diff, explanation, expiresAt. |
/edit/apply, /edit | success, decisionChainId, versionId, versionNumber, appliedChainJson. |
/versions | versions (id, versionNumber, createdAt, createdBy, changeDescription, changeSource, blockCount), total, decisionChainId. |
/rollback | success, decisionChainId, restoredVersionId, restoredVersionNumber, newVersionId, newVersionNumber, restoredChainJson. |
| Status | When |
|---|---|
400 | A required field is missing. |
401 | Invalid token. |
403 | The token cannot reach this account. |
408 | Time limit reached. |
500 | Internal error. |