Agent

Wait For Agent Session

Changed on

Wait until the Agent turn finishes or timeoutSeconds elapses (default 60, maximum 300). Pass the runId returned by send-message so an earlier turn is not mistaken for this one. Call again when timedOut is true until finished is true. A timeout does not stop the turn.

post/agent/wait-for-session

Request

  • Base URL: https://api.krea.ai
  • URL: https://api.krea.ai/agent/wait-for-session
  • Auth: HTTP bearer

Request body

sessionIdstring uuid required

Session id returned by send_agent_message

timeoutSecondsinteger
runIdstring uuid

runId from send_agent_message, so a previous turn's finished status is not mistaken for this one

Response

The Agent session result.

sessionIdstring required
threadIdstring required
runIdstring
status'not_started' | 'running' | 'completed' | 'failed' | 'cancelled' required
finishedboolean required

True once status is completed, failed, or cancelled

textstring required

Latest assistant message text

errorstring
urlstring required

The session in the Krea app

timedOutboolean required

Changes