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

# Get apiv1sessions 1

> Get session by ID



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/v1/sessions/{sessionId}
openapi: 3.0.0
info:
  title: QYL Observability API
  version: '2026-01-26'
servers:
  - url: https://api.staging.qyl.dev
    description: QYL Staging API
    variables: {}
  - url: https://api.qyl.dev
    description: QYL Production API
    variables: {}
security: []
tags:
  - name: Streaming
  - name: Traces
  - name: Logs
  - name: Metrics
  - name: Sessions
  - name: Errors
  - name: Deployments
  - name: Services
  - name: Health
  - name: Workspaces
  - name: Onboarding
  - name: Configurator
  - name: Issues
  - name: Workflows
  - name: Search
  - name: Alerts
paths:
  /api/v1/sessions/{sessionId}:
    get:
      tags:
        - Sessions
      description: Get session by ID
      operationId: SessionsApi_get
      parameters:
        - name: sessionId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Qyl.Domains.Observe.Session.SessionEntity'
        '404':
          description: Resource not found (404)
          headers:
            X-Trace-Id:
              required: false
              description: Trace ID for correlation
              schema:
                type: string
            X-Request-Id:
              required: false
              description: Request ID for support
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Qyl.Common.Errors.NotFoundError'
        '500':
          description: Internal server error (500)
          headers:
            X-Trace-Id:
              required: false
              description: Trace ID for correlation
              schema:
                type: string
            X-Request-Id:
              required: false
              description: Request ID for support
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Qyl.Common.Errors.InternalServerError'
components:
  schemas:
    Qyl.Domains.Observe.Session.SessionEntity:
      type: object
      required:
        - session.id
        - start_time
        - trace_count
        - span_count
        - error_count
        - services
        - state
      properties:
        session.id:
          allOf:
            - $ref: '#/components/schemas/Qyl.Common.SessionId'
          description: Session ID
        user.id:
          allOf:
            - $ref: '#/components/schemas/Qyl.Common.UserId'
          description: User ID (if authenticated)
        start_time:
          type: string
          format: date-time
          description: Session start time
        end_time:
          type: string
          format: date-time
          description: Session end time
        duration_ms:
          allOf:
            - $ref: '#/components/schemas/Qyl.Common.DurationMs'
          description: Session duration in milliseconds
        trace_count:
          type: integer
          format: int32
          minimum: 0
          description: Total trace count in session
        span_count:
          type: integer
          format: int32
          minimum: 0
          description: Total span count in session
        error_count:
          type: integer
          format: int32
          minimum: 0
          description: Total error count in session
        services:
          type: array
          items:
            type: string
          description: Service names observed in this session
        state:
          allOf:
            - $ref: '#/components/schemas/Qyl.Domains.Observe.Session.SessionState'
          description: Session state
        client:
          allOf:
            - $ref: >-
                #/components/schemas/Qyl.Domains.Observe.Session.SessionClientInfo
          description: Client information
        geo:
          allOf:
            - $ref: '#/components/schemas/Qyl.Domains.Observe.Session.SessionGeoInfo'
          description: Location information
        genai_usage:
          allOf:
            - $ref: >-
                #/components/schemas/Qyl.Domains.Observe.Session.SessionGenAiUsage
          description: GenAI usage summary
      description: Complete session entity with aggregated data
      x-csharp-type: SessionEntity
      x-duckdb-table: session_entities
    Qyl.Common.Errors.NotFoundError:
      type: object
      required:
        - title
      properties:
        title:
          type: string
          enum:
            - Not Found
        resource_type:
          type: string
          description: The type of resource that was not found
        resource_id:
          type: string
          description: The identifier that was not found
      allOf:
        - $ref: '#/components/schemas/Qyl.Common.Errors.ProblemDetails'
      description: Resource not found (404)
    Qyl.Common.Errors.InternalServerError:
      type: object
      required:
        - title
      properties:
        title:
          type: string
          enum:
            - Internal Server Error
        error_code:
          type: string
          description: Error code for support reference
      allOf:
        - $ref: '#/components/schemas/Qyl.Common.Errors.ProblemDetails'
      description: Internal server error (500)
    Qyl.Common.SessionId:
      type: string
      minLength: 1
      maxLength: 128
      description: Unique session identifier
      x-csharp-type: SessionId
      x-csharp-struct: true
      x-duckdb-type: VARCHAR(128)
    Qyl.Common.UserId:
      type: string
      minLength: 1
      maxLength: 256
      description: User identifier (pseudonymized for privacy)
    Qyl.Common.DurationMs:
      type: number
      format: double
      minimum: 0
      description: Duration in milliseconds
      x-csharp-type: double
      x-duckdb-type: DOUBLE
    Qyl.Domains.Observe.Session.SessionState:
      type: string
      enum:
        - active
        - idle
        - ended
        - timed_out
        - invalidated
      description: Session states
    Qyl.Domains.Observe.Session.SessionClientInfo:
      type: object
      properties:
        ip:
          allOf:
            - $ref: '#/components/schemas/Qyl.Common.IpAddress'
          description: Client IP address
        user_agent:
          allOf:
            - $ref: '#/components/schemas/Qyl.Common.UserAgent'
          description: User agent string
        device_type:
          allOf:
            - $ref: '#/components/schemas/Qyl.Domains.Observe.Session.DeviceType'
          description: Device type
        os:
          type: string
          description: Operating system
        browser:
          type: string
          description: Browser name
        browser_version:
          type: string
          description: Browser version
      description: Session client information
    Qyl.Domains.Observe.Session.SessionGeoInfo:
      type: object
      properties:
        country_code:
          type: string
          description: Country code (ISO 3166-1 alpha-2)
        country_name:
          type: string
          description: Country name
        region:
          type: string
          description: Region/state
        city:
          type: string
          description: City
        postal_code:
          type: string
          description: Postal code
        timezone:
          type: string
          description: Timezone
      description: Session geographic information
    Qyl.Domains.Observe.Session.SessionGenAiUsage:
      type: object
      required:
        - request_count
        - total_input_tokens
        - total_output_tokens
        - models_used
        - providers_used
      properties:
        request_count:
          type: integer
          format: int32
          minimum: 0
          description: Total GenAI requests in session
        total_input_tokens:
          allOf:
            - $ref: '#/components/schemas/Qyl.Common.TokenCount'
          description: Total input tokens consumed
        total_output_tokens:
          allOf:
            - $ref: '#/components/schemas/Qyl.Common.TokenCount'
          description: Total output tokens generated
        models_used:
          type: array
          items:
            type: string
          description: Models used in session
        providers_used:
          type: array
          items:
            type: string
          description: Providers used in session
        estimated_cost_usd:
          type: number
          format: double
          description: Estimated cost in USD
      description: Session GenAI usage summary
    Qyl.Common.Errors.ProblemDetails:
      type: object
      required:
        - type
        - title
        - status
      properties:
        type:
          type: string
          format: uri
          description: A URI reference identifying the problem type
          default: about:blank
        title:
          type: string
          description: A short, human-readable summary of the problem type
        status:
          type: integer
          format: int32
          description: >-
            The HTTP status code (informational only, actual code set by
            subtype)
        detail:
          type: string
          description: A human-readable explanation specific to this occurrence
        instance:
          type: string
          format: uri
          description: A URI reference identifying the specific occurrence
        timestamp:
          type: string
          format: date-time
          description: Timestamp of the error
      description: RFC 7807 Problem Details for HTTP APIs
    Qyl.Common.IpAddress:
      type: string
      description: IP address (IPv4 or IPv6)
    Qyl.Common.UserAgent:
      type: string
      description: User agent string
      example: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
    Qyl.Domains.Observe.Session.DeviceType:
      type: string
      enum:
        - desktop
        - mobile
        - tablet
        - tv
        - console
        - wearable
        - iot
        - bot
        - unknown
      description: Device types
    Qyl.Common.TokenCount:
      type: integer
      format: int64
      minimum: 0
      description: Token count (for LLM operations)
      x-csharp-type: long
      x-duckdb-type: BIGINT

````