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

# Get Run by ID

> Retrieve a specific run by its ID from a session. Response schema varies based on the run type (agent run, team run, or workflow run).



## OpenAPI

````yaml get /sessions/{session_id}/runs/{run_id}
openapi: 3.1.0
info:
  title: Agno AgentOS
  description: An agent operating system.
  version: 1.0.0
servers: []
security: []
paths:
  /sessions/{session_id}/runs/{run_id}:
    get:
      tags:
        - Sessions
      summary: Get Run by ID
      description: >-
        Retrieve a specific run by its ID from a session. Response schema varies
        based on the run type (agent run, team run, or workflow run).
      operationId: get_session_run
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            description: Session ID to get run from
            title: Session Id
          description: Session ID to get run from
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            description: Run ID to retrieve
            title: Run Id
          description: Run ID to retrieve
        - name: type
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/SessionType'
            description: Session type (agent, team, or workflow)
            default: agent
          description: Session type (agent, team, or workflow)
        - name: user_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: User ID to query run from
            title: User Id
          description: User ID to query run from
        - name: db_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Database ID to query run from
            title: Db Id
          description: Database ID to query run from
      responses:
        '200':
          description: Run retrieved successfully
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/RunSchema'
                  - $ref: '#/components/schemas/TeamRunSchema'
                  - $ref: '#/components/schemas/WorkflowRunSchema'
                title: Response Get Session Run
              examples:
                agent_run:
                  summary: Example agent run
                  value:
                    run_id: fcdf50f0-7c32-4593-b2ef-68a558774340
                    parent_run_id: 80056af0-c7a5-4d69-b6a2-c3eba9f040e0
                    agent_id: basic-agent
                    user_id: user_123
                    run_input: Which tools do you have access to?
                    content: I don't have access to external tools.
                    created_at: 1728499200
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedResponse'
        '404':
          description: Session or run not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Invalid session type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    SessionType:
      type: string
      enum:
        - agent
        - team
        - workflow
      title: SessionType
    RunSchema:
      properties:
        run_id:
          type: string
          title: Run Id
        parent_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Run Id
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
        run_input:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Input
        content:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Content
        run_response_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Response Format
        reasoning_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Reasoning Content
        reasoning_steps:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Reasoning Steps
        metrics:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metrics
        messages:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Messages
        tools:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tools
        events:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Events
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        references:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: References
        reasoning_messages:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Reasoning Messages
        images:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Images
        videos:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Videos
        audio:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Audio
        files:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Files
        response_audio:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Response Audio
        input_media:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Media
      type: object
      required:
        - run_id
        - parent_run_id
        - agent_id
        - user_id
        - run_input
        - content
        - run_response_format
        - reasoning_content
        - reasoning_steps
        - metrics
        - messages
        - tools
        - events
        - created_at
        - references
        - reasoning_messages
        - images
        - videos
        - audio
        - files
        - response_audio
        - input_media
      title: RunSchema
    TeamRunSchema:
      properties:
        run_id:
          type: string
          title: Run Id
        parent_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Run Id
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
        content:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Content
        reasoning_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Reasoning Content
        reasoning_steps:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Reasoning Steps
        run_input:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Input
        run_response_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Response Format
        metrics:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metrics
        tools:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tools
        messages:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Messages
        events:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Events
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        references:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: References
        reasoning_messages:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Reasoning Messages
        input_media:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Media
        images:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Images
        videos:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Videos
        audio:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Audio
        files:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Files
        response_audio:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Response Audio
      type: object
      required:
        - run_id
        - parent_run_id
        - team_id
        - content
        - reasoning_content
        - reasoning_steps
        - run_input
        - run_response_format
        - metrics
        - tools
        - messages
        - events
        - created_at
        - references
        - reasoning_messages
        - input_media
        - images
        - videos
        - audio
        - files
        - response_audio
      title: TeamRunSchema
    WorkflowRunSchema:
      properties:
        run_id:
          type: string
          title: Run Id
        run_input:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Input
        events:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Events
        workflow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Id
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
        content:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Content
        content_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Type
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        step_results:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Step Results
        step_executor_runs:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Step Executor Runs
        metrics:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metrics
        created_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created At
        reasoning_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Reasoning Content
        reasoning_steps:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Reasoning Steps
        references:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: References
        reasoning_messages:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Reasoning Messages
        images:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Images
        videos:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Videos
        audio:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Audio
        files:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Files
        response_audio:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Response Audio
      type: object
      required:
        - run_id
        - run_input
        - events
        - workflow_id
        - user_id
        - content
        - content_type
        - status
        - step_results
        - step_executor_runs
        - metrics
        - created_at
        - reasoning_content
        - reasoning_steps
        - references
        - reasoning_messages
        - images
        - videos
        - audio
        - files
        - response_audio
      title: WorkflowRunSchema
    BadRequestResponse:
      properties:
        detail:
          type: string
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      required:
        - detail
      title: BadRequestResponse
      example:
        detail: Bad request
        error_code: BAD_REQUEST
    UnauthenticatedResponse:
      properties:
        detail:
          type: string
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      required:
        - detail
      title: UnauthenticatedResponse
      example:
        detail: Unauthenticated access
        error_code: UNAUTHENTICATED
    NotFoundResponse:
      properties:
        detail:
          type: string
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      required:
        - detail
      title: NotFoundResponse
      example:
        detail: Not found
        error_code: NOT_FOUND
    ValidationErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      required:
        - detail
      title: ValidationErrorResponse
      example:
        detail: Validation error
        error_code: VALIDATION_ERROR
    InternalServerErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      required:
        - detail
      title: InternalServerErrorResponse
      example:
        detail: Internal server error
        error_code: INTERNAL_SERVER_ERROR
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````