---
title: "Wait For Agent Session"
method: POST
path: "/agent/wait-for-session"
tags: ["Agent"]
---

# Wait For Agent Session

`POST /agent/wait-for-session`

## Request

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

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.

## Request body

- object
  - `sessionId` string, uuid, required: Session id returned by send_agent_message
  - `timeoutSeconds` integer
  - `runId` string, uuid: runId from send_agent_message, so a previous turn's finished status is not mistaken for this one

## Response `200`

The Agent session result.

- object
  - `sessionId` string, required
  - `threadId` string, required
  - `runId` string
  - `status` 'not_started' | 'running' | 'completed' | 'failed' | 'cancelled', required
  - `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)
    - `jobId` string
    - `mediaKind` 'image' | 'video' | 'audio' | '3d'
    - `url` string
    - `uri` string
    - `name` string
    - `mimeType` string
  - `error` string
  - `url` string, required: The session in the Krea app
  - `timedOut` boolean, required

## Other responses

- `400`: Invalid JSON body.
- `401`: Authentication required.
- `402`: Insufficient compute unit balance or free message limit reached.
- `403`: The requested model is not included in the workspace plan.
- `404`: Session or attachment not found or not accessible.
- `409`: A turn is already in progress.
- `422`: Invalid input or desktop app unavailable.

## Changes

- **2026-10-20** `8bea1de4b828`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/krea/apis/krea-api/changes/agent/wait-for-session/post.md)

---

[API](https://skmtc.dev/krea/apis/krea-api.md) · [All operations](https://skmtc.dev/krea/apis/krea-api/llms.txt) · [OpenAPI document](https://skmtc.dev/krea/apis/krea-api/revisions/f503def6ccba?raw)
