Start an agent turn
Starts a new agent turn. With delivery: after_turn and a stable UUID clientTurnId, the turn starts now when the chat is idle and its queue empty, and otherwise joins the durable FIFO queue; a retry with the same id returns the same receipt. An immediate turn can include editFrom: {messageId, tipId} to replace a prompt and remove later transcript rows atomically with admission, restoring the workflow checkpoint those rows made. The draft endpoint supplies the current tip. Callers omitting delivery get 409 while the chat is busy or has queued messages. Queued replies include {queued:true,queueId,sessionId,state}; started turns include the durable handle {runId, sessionId, jobId}. The turn runs detached; stream its events over the session WebSocket or poll the session. agentMode is required. The SDK's sessions.dispatch.
/api/agent/runssessionIdstringrequiredpromptstringclientTurnIdstringeditFromobjectmessageIdstringrequiredtipIdstringrequiredresumebooleandeliveryenumOne of: after_turn
modelIdstringworkflowIdstringworkflowRunIdobjectworkflowNamestringversionIdstringcheckpointVersionIdstringvaultIdstringspaceIdstringworkflowDataobjectworkflowDataHashstringlastRunIdstringworkflowHasSchedulebooleanlastRunStatusobjectrunIdstringrequiredstatusstringrequiredcompletedAtstringworkbenchObservationobjectschemaVersionenumrequiredOne of: 1
surfaceIdstringrequiredgenerationstringrequiredrevisionintegerrequiredsessionIdstringrequiredobservedAtstringrequiredworkspaceVisiblebooleanrequiredactiveTabIdstringrequiredtabsobject[]requiredtabIdstringrequiredkindstringrequiredtitlestringrequiredviewenumrequiredOne of: workflow, database, files, app, desktop, device, resource, new, unknown
targetobjectworkflowIdobjectagentSessionIdobjectcomputerIdobjectpageIdstringbrowserTargetobjectsessionIdstringrequiredtargetIdstringrequiredrevisionintegerrequiredsandboxSessionIdstringrequirednativeIdstringrequiredvaultIdobjectsandboxIdobjectversionIdobjectrunIdobjectsubjobIdobjectmoduleIdobjectnodeNameobjecthierarchyobjecttableIdobjectqueryIdobjectresourceIdobjectlibraryItemTypeenumOne of: tool, script, module, workflow, solution
conversationViewenumOne of: list
desktopDeviceenumOne of: android
scopeobjectfilePathstringfileViewenumOne of: preview, source, split
requestedUrlobjecturlobjectappIdobjectrenderedUrlobjectdisplayedUrlobjectdeployedUrlobjectomittedTabCountintegerrequirededitorModeenumOne of: workflow, app, agent, database
moduleContextobjectisModuleWorkflowbooleanrequiredmoduleWorkflowIdstringparentWorkflowIdstringparentWorkflowNamestringreturnToNodestringagentModeenumrequiredOne of: agent, plan
focusedNodestringfocusedNodeContextobjectmentionedNodesstring[]timezonestringappContextstringsandboxSessionIdstringsandboxPreviewUrlstringsandboxDatasetsobject[]tableIdstringrequiredtableNamestringrequiredcolumnsobject[]requirednamestringrequiredtypestringrequiredimageAttachmentsobject[]typeenumrequiredOne of: image
datastringrequiredmimeTypestringrequirednamestringrequiredsizenumberrequiredfileAttachmentsobject[]typeenumrequiredOne of: file
idstringrequirednamestringrequiredsizenumberrequiredannotationsobjectinteractiveenumOne of: true
Request
curl -X POST https://trickest.io/api/agent/runs \
-H "Authorization: Token $TRICKEST_TOKEN" \
-H "Content-Type: application/json" \
-d '{ }'Responses
codestringrequiredmessagestringrequireddetailsobjectField-level detail when the error is a validation failure.
codestringrequiredmessagestringrequireddetailsobjectField-level detail when the error is a validation failure.
codestringrequiredmessagestringrequireddetailsobjectField-level detail when the error is a validation failure.
codestringrequiredmessagestringrequireddetailsobjectField-level detail when the error is a validation failure.
codestringrequiredmessagestringrequireddetailsobjectField-level detail when the error is a validation failure.