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

# Get a session

> Get a session by id. Visible to the session owner or a manager of the session agent.



## OpenAPI

````yaml /gateway-agent-harness-openapi.json get /v1/agents/sessions/{sessionId}
openapi: 3.1.0
info:
  title: TrueFoundry Agent Harness
  description: Stateful agent execution API.
  version: 0.1.0
servers:
  - url: '{scheme}://{gatewayBaseURL}/{tenantName}'
    variables:
      scheme:
        default: https
        enum:
          - http
          - https
      gatewayBaseURL:
        default: gateway.truefoundry.ai
        description: Gateway host. Override for self-hosted deployments.
      tenantName:
        default: truefoundry
        description: Tenant identifier
    description: Gateway base URL (per-tenant)
security:
  - AuthorizationBearer: []
paths:
  /v1/agents/sessions/{sessionId}:
    get:
      tags:
        - Agent Harness
      summary: Get a session
      description: >-
        Get a session by id. Visible to the session owner or a manager of the
        session agent.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
            description: Session identifier.
          required: true
          description: Session identifier.
          name: sessionId
          in: path
      responses:
        '200':
          description: Session data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSessionResponse'
        '401':
          description: Missing or invalid authentication token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestErrorResponse'
        '403':
          description: Caller is not authorized to access this session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestErrorResponse'
        '404':
          description: Session not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestErrorResponse'
components:
  schemas:
    GetSessionResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Session'
      required:
        - data
    RequestErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type:
                - string
                - 'null'
            param:
              type:
                - string
                - 'null'
          required:
            - message
      required:
        - error
    Session:
      type: object
      properties:
        id:
          type: string
        agent_name:
          type: string
        title:
          type:
            - string
            - 'null'
        created_by_subject:
          $ref: '#/components/schemas/Subject'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - agent_name
        - title
        - created_by_subject
        - created_at
        - updated_at
    Subject:
      type: object
      properties:
        subject_id:
          type: string
        subject_type:
          type: string
        subject_slug:
          type:
            - string
            - 'null'
      required:
        - subject_id
        - subject_type
  securitySchemes:
    AuthorizationBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````