> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch stored media for a session

> 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.



## OpenAPI

````yaml get /sessions/{session_id}/media/{storage_key}
openapi: 3.1.0
info:
  title: Agno API Reference
  description: The all-in-one, private, secure agent platform that runs in your cloud.
  version: 3.0.4
servers: []
security: []
paths:
  /sessions/{session_id}/media/{storage_key}:
    get:
      tags:
        - Media
      summary: Fetch stored media for a session
      description: >-
        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.
      operationId: get_session_media
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            description: Session ID the media belongs to
            title: Session Id
          description: Session ID the media belongs to
        - name: storage_key
          in: path
          required: true
          schema:
            type: string
            description: Storage key of the media to fetch
            title: Storage Key
          description: Storage key of the media to fetch
        - name: type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/SessionType'
              - type: 'null'
            description: >-
              Session type (agent, team, or workflow). If not provided,
              auto-detected from session data.
            title: Type
          description: >-
            Session type (agent, team, or workflow). If not provided,
            auto-detected from session data.
        - name: user_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: User ID to query session from
            title: User Id
          description: User ID to query session from
        - name: db_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Database ID to query session from
            title: Db Id
          description: Database ID to query session from
        - name: table
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Table to query session from
            title: Table
          description: Table to query session from
        - name: redirect
          in: query
          required: false
          schema:
            type: boolean
            description: Redirect to a freshly-signed URL instead of streaming bytes
            default: false
            title: Redirect
          description: Redirect to a freshly-signed URL instead of streaming bytes
      responses:
        '200':
          description: The media bytes, served with the stored mime type
          content:
            application/json:
              schema: {}
            application/octet-stream:
              schema:
                type: string
                format: binary
        '307':
          description: >-
            Redirect to a freshly signed HTTP or HTTPS media URL when
            redirect=true
          headers:
            Location:
              description: Freshly signed media URL
              schema:
                type: string
                format: uri
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedResponse'
        '403':
          description: 'Insufficient permissions. Required scope(s): sessions:read'
        '404':
          description: Session or media not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Media storage could not be reached
        '501':
          description: Remote databases are not supported
        '503':
          description: Media storage is not configured
      security:
        - {}
        - HTTPBearer: []
components:
  schemas:
    SessionType:
      type: string
      enum:
        - agent
        - team
        - workflow
      title: SessionType
    UnauthenticatedResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message
        error_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Id
          description: >-
            Stable identifier for the specific error, present only when the
            error carries one
        error_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Type
          description: Category of the error, present only when the error carries one
      type: object
      required:
        - detail
      title: UnauthenticatedResponse
      example:
        detail: Unauthenticated access
    NotFoundResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message
        error_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Id
          description: >-
            Stable identifier for the specific error, present only when the
            error carries one
        error_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Type
          description: Category of the error, present only when the error carries one
      type: object
      required:
        - detail
      title: NotFoundResponse
      example:
        detail: Not found
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````