Skip to main content
POST
Wait For Agent Session

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
sessionId
string<uuid>
required

Session id returned by send_agent_message

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
timeoutSeconds
integer
default:60
Required range: 1 <= x <= 300
runId
string<uuid>

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

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

Response

The Agent session result.

sessionId
string
required
threadId
string
required
status
enum<string>
required
Available options:
not_started,
running,
completed,
failed,
cancelled
finished
boolean
required

True once status is completed, failed, or cancelled

text
string
required

Latest assistant message text

media
object[]
required

Media the session produced — the deliverables the agent presented, plus its other generations while a turn is running. Order is not significant. Each item is {jobId, mediaKind?} for a generation (fetch it with get_job), {url} for rehosted media, or {uri, name, mimeType} for a Krea file (read it with read_files)

url
string
required

The session in the Krea app

timedOut
boolean
required
runId
string
error
string