---
title: "Send a follow-up"
method: POST
path: "/o/{org}/sessions/{session}/messages"
tags: ["Messages"]
---

# Send a follow-up

`POST /o/{org}/sessions/{session}/messages`

## Request

- Base URL: `https://api.prix.dev`
- URL: `https://api.prix.dev/o/{org}/sessions/{session}/messages`
- Auth: HTTP bearer

Delivers a message to the session's agent once its turn has finished. A
parked sandbox is woken first. While a turn is still running the message is
refused with `409 TURN_ACTIVE`; send it when the session's `status` leaves
`running`. Files land in the sandbox beside the session's first ones.

## Request body

- object
  - `input` union, required: The task, as a string or as content blocks. Text blocks are joined, with a blank line between them, into the prompt (at most 256 KiB, at least one text block). Every file block is stored before the run starts and downloaded into the sandbox at `/workspace/.rush/attachments/`, where the prompt names it.
    - string
    - InputBlock[]
      - union
        - object
          - `type` 'text', required
          - `text` string, required
        - object
          - `type` 'image' | 'document' | 'file', required: What the file is. `image` must be an `image/*` type; `document` and `file` take any type.
          - `name` string: The file name in the sandbox. No `/`, `\`, `..`, leading `.`, or control characters. Default: the URL's last segment, else `input-<n>`, given the extension its `Content-Type` reads as when it has none.
          - `source` union, required: Where the bytes come from. `url`: a public https file Rush fetches (public addresses only, at most 3 redirects, 60 seconds, no size limit). `base64`: the bytes in the request, which is limited to 32 MB in all. `file`: an id from `POST /o/{org}/files`, for a large private file; each id rides on one run.
            - object
              - …
            - object
              - …
            - object
              - …

## Response `202`

Delivered; the session as `GET` reads it, `status` `running` its new turn.

- CloudRunSession: A session as `GET …/sessions/{session}` and the session list return it. It starts with where the session lives, so its path is `/o/{org_id}/sessions/{execution_id}`; `project_id` appears only for a session the console ran in a Project. A field appears only when it has a value, and every time is RFC 3339 UTC with milliseconds. A create, a cancel and a follow-up answer it too. It has no `prompt`: the caller has its input, and `/messages` has every turn.
  - `execution_id` string, required: The session id.
  - `org_id` string, required: The org as the request's path named it.
  - `project_id` string, uuid: The Project the console ran the session in.
  - `status` 'queued' | 'allocating' | 'running' | 'paused' | 'input_required' | 'needs_review' | 'completed' | 'failed' | 'cancelling' | 'cancelled' | 'expired', required: `paused` is a resumable session parked between turns; `needs_review` finished without the proof it was asked for; `cancelling` appears only in the `202` answer to a cancel whose sandbox is still being released; `GET` reads `cancelled` once it is.
  - `harness` string: `claude`, `codex` or `opencode`.
  - `agent_id` string, uuid: The saved agent the session was started from, if any.
  - `model` string
  - `effort` string
  - `result` string: The agent's final answer for the last finished turn, in full.
  - `error` object
    - `code` string, required
    - `message` string, required
  - `repo_owner` string
  - `repo_name` string
  - `branch` string
  - `pr_url` string
  - `input_tokens` integer
  - `output_tokens` integer
  - `cache_read_tokens` integer
  - `cache_write_tokens` integer
  - `total_tokens` integer: Uncached input plus cache writes plus output.
  - `reasoning_tokens` integer
  - `total_cost_usd` number
  - `tool_calls_count` integer
  - `turns_count` integer
  - `artifacts` object[]: Every file the agent saved to `/workspace/.rush/artifacts/`. `url` downloads it from this API with no credential until `url_expires_at`, an hour after the read; read the session again for a fresh link. `GET …/artifacts/{name}` with the key also downloads it.
    - `name` string, required
    - `mime_type` string, required
    - `url` string, uri, required: A signed https link to the file on this API.
    - `url_expires_at` string, date-time, required
  - `attachments` object[]: The files the session was started or followed up with. `url` downloads one with no credential until `url_expires_at`, as for artifacts; `GET …/attachments/{id}` with the key also downloads it.
    - `id` string, uuid, required
    - `name` string, required
    - `mime_type` string, required
    - `url` string, uri, required: A signed https link to the file on this API.
    - `url_expires_at` string, date-time, required
  - `created_at` string, date-time
  - `completed_at` string, date-time

## Other responses

- `400`: No `input` or a malformed one (`INVALID_BODY`), its text over 256 KiB (`CONTENT_TOO_LARGE`), or the removed `content` field (`FIELD_REMOVED`, naming `input`).
- `401`: No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.
- `402`: The plan does not cover more usage (same codes as starting a session).
- `403`: Files on a follow-up from someone other than the session's owner (`FORBIDDEN`).
- `404`: No such resource for the caller, including one in an org the caller is not in or a Project that is private to someone else.
- `409`: The session cannot take a message: it is closed (`TASK_TERMINAL`), not started yet, still working on a turn (`TURN_ACTIVE`), or its run cannot be continued (`CONTINUATION_UNSUPPORTED`), or its Project is paused (`PROJECT_PAUSED`). A `file_id` another run holds is `ATTACHMENT_IN_USE`; one never `PUT` to its `upload_url` is `ATTACHMENT_NOT_UPLOADED`.
- `413`: The request body is over 32 MB (`REQUEST_TOO_LARGE`), as on session create.
- `422`: A `url` source could not be fetched (`INPUT_FETCH_FAILED`), as on session create, or a connection the session named was deleted, expired or revoked since (`CONNECTION_UNAVAILABLE`, naming its id). Nothing reached the sandbox.
- `503`: The runtime could not take the message right now; nothing was delivered. Retry.

---

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