Developers
ENPT

Flow AssistantBeta

Ask questions about your automations, and create or change them by describing what you want.

Beta

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.

RouteMethodBodyDoes
/askPOSThostId, question, avatarId (optional)Answers a question. Read only. Up to 90 seconds.
/create/previewPOSThostId, prompt, avatarId, decisionName, agents (last three optional)Proposes a new automation without saving.
/create/applyPOSThostId, previewId or proposedChain, avatarId, userId, activeSaves a proposed automation. active defaults to true.
/createPOSTSame as /create/previewProposes and saves in one call.
/edit/previewPOSThostId, decisionChainId, instruction, avatarId (optional)Proposes a change without saving.
/edit/applyPOSThostId, decisionChainId, previewId or proposedChainJson, userIdSaves a proposed change.
/editPOSTSame as /edit/previewProposes and saves in one call.
/versionsGETQuery: decisionChainId, limit (default 20), offset (default 0)Lists versions of an automation.
/rollbackPOSThostId, decisionChainId, versionId, userIdRestores 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:

RouteFields
/askanswer, referencedBlocks (automation, block type and index), confidence (high, medium, low).
/create/previewpreviewId, proposedChain (decisionName, instructions, chainJson), summary, explanation, expiresAt.
/create/apply, /createsuccess, decisionChainId, decisionName, versionId, versionNumber, chainJson, active.
/edit/previewpreviewId, currentChainJson, proposedChainJson, diff, explanation, expiresAt.
/edit/apply, /editsuccess, decisionChainId, versionId, versionNumber, appliedChainJson.
/versionsversions (id, versionNumber, createdAt, createdBy, changeDescription, changeSource, blockCount), total, decisionChainId.
/rollbacksuccess, decisionChainId, restoredVersionId, restoredVersionNumber, newVersionId, newVersionNumber, restoredChainJson.
StatusWhen
400A required field is missing.
401Invalid token.
403The token cannot reach this account.
408Time limit reached.
500Internal error.

Previous

Automations

Next

Reports