Media
Fetch Stored Media for a Session
Storage and access
Configure media_storage, a supported session database and a persisted run reference to the media. The key must belong to that session and match the stored backend/bucket/region identity. Missing media storage returns 503; RemoteDb returns 501.
Session ownership filtering follows configured user scope: JWT user isolation is opt-in, while non-admin service-account PAT callers self-scope. Scoped access to another user's session returns 404. The key-membership checks still apply to unscoped callers.
Bytes and redirects
The handler downloads the complete body before returning its bytes; it does not stream the storage download incrementally. With redirect=true, it returns 307 only when the backend supplies an HTTP(S) URL. A local file URL or absent URL falls back to the byte response.
Responses use the stored media type after validation. Active content types such as HTML, SVG, JavaScript and XML are served as an application/octet-stream attachment with nosniff. Do not assume the generic JSON response schema describes the returned media body.
/sessions/{session_id}/media/{storage_key}Stream (or, with redirect=true, redirect to a freshly-signed URL for) a piece of media stored in external media storage. Scoped to the caller's session ownership; the storage_key must belong to the session.
Authorization
HTTPBearer In: header
Path Parameters
Session ID the media belongs to
Storage key of the media to fetch
Query Parameters
Session type (agent, team, or workflow). If not provided, auto-detected from session data.
User ID to query session from
Database ID to query session from
Table to query session from
Redirect to a freshly-signed URL instead of streaming bytes
falseResponse Body
application/json
application/json
application/json
curl --request GET 'https://example.com/sessions/string/media/string'null{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": [ { "loc": [ "string" ], "msg": "string", "type": "string", "input": null, "ctx": {} } ]}