Send a command to a running session

Send a command to a running session

Sends a control message to the run currently bound to the session: {type: 'stop'} aborts it, {type: 'inject', content} delivers mid-turn steering text, {type: 'cancel_run_wake', runId} stops the session waking when that run finishes, {type: 'background_command', runId, toolCallId} requests handoff of a worker-advertised foreground command without restarting it, {type: 'send_queued_now', queueId, revision} moves the owner's waiting text-only message into the live run as a steer ({steered: true, messageId}; 409 STEER_REJECTED with reason, 409 REVISION_CONFLICT or 404 leave the message queued), {type: 'clear'} empties the conversation: it stops a running turn, deletes every message, queued message and the chat's session memory, dismisses pending questions, clears todos and cancels an unfinished goal ({cleared, goalCancelled}; 409 CLEAR_REJECTED when a turn does not stop within 20 s). The SDK's sessions.stop / sessions.inject.

POST/api/agent/sessions/{sessionId}/commands
Path parameters
sessionIdstringrequired
Body

Request

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

Responses

200Command outcome
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.