Start an agent turn

Start an agent turn

Starts a new agent turn in a session and returns 202 with 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.

POST/api/agent/runs
Body
sessionIdstringrequired
promptstring
clientTurnIdstring
resumeboolean
modelIdstring
workflowIdstring
workflowRunIdobject
workflowNamestring
versionIdstring
checkpointVersionIdstring
vaultIdstring
spaceIdstring
workflowDataobject
workflowDataHashstring
lastRunIdstring
isScheduledboolean
lastRunStatusobject

runIdstringrequired
statusstringrequired
completedAtstring
editorModeenum

One of: workflow, app, agent, database

moduleContextobject

isModuleWorkflowbooleanrequired
moduleWorkflowIdstring
parentWorkflowIdstring
parentWorkflowNamestring
returnToNodestring
agentModeenumrequired

One of: agent, plan

focusedNodestring
focusedNodeContextobject
mentionedNodesstring[]
timezonestring
appContextstring
sandboxSessionIdstring
sandboxPreviewUrlstring
sandboxDatasetsobject[]

tableIdstringrequired
tableNamestringrequired
columnsobject[]required

namestringrequired
typestringrequired
imageAttachmentsobject[]

typeenumrequired

One of: image

datastringrequired
mimeTypestringrequired
namestringrequired
sizenumberrequired
fileAttachmentsobject[]

typeenumrequired

One of: file

idstringrequired
namestringrequired
sizenumberrequired

Request

curl
curl -X POST https://trickest.io/api/agent/runs \
  -H "Authorization: Token $TRICKEST_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ }'

Responses

202Turn accepted
runIdstringrequired
sessionIdstringrequired
jobIdstringrequired
400Bad Request – validation error or malformed input
codestringrequired
messagestringrequired
detailsobject

Field-level detail when the error is a validation failure.

401Unauthorized – missing or expired token
codestringrequired
messagestringrequired
detailsobject

Field-level detail when the error is a validation failure.

403Forbidden – insufficient permissions
codestringrequired
messagestringrequired
detailsobject

Field-level detail when the error is a validation failure.

429Too Many Requests – rate limited
codestringrequired
messagestringrequired
detailsobject

Field-level detail when the error is a validation failure.

500Internal Server Error
codestringrequired
messagestringrequired
detailsobject

Field-level detail when the error is a validation failure.