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

> List sessions



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/v1/sessions
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:
    get:
      tags:
        - Sessions
      description: List sessions
      operationId: SessionsApi_list
      parameters:
        - name: userId
          in: query
          required: false
          description: User ID filter
          schema:
            $ref: '#/components/schemas/Qyl.Common.UserId'
          explode: false
        - name: isActive
          in: query
          required: false
          description: Is active filter
          schema:
            type: boolean
          explode: false
        - name: startTime
          in: query
          required: false
          description: Start time
          schema:
            type: string
            format: date-time
          explode: false
        - name: endTime
          in: query
          required: false
          description: End time
          schema:
            type: string
            format: date-time
          explode: false
        - name: limit
          in: query
          required: false
          description: Page size
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 1000
            default: 100
          explode: false
        - name: cursor
          in: query
          required: false
          description: Cursor
          schema:
            type: string
          explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                  - has_more
                properties:
                  items:
                    type: array
                    items:
                      $ref: >-
                        #/components/schemas/Qyl.Domains.Observe.Session.SessionEntity
                    description: List of items in this page
                  next_cursor:
                    type: string
                    description: Cursor for the next page (null if no more pages)
                  prev_cursor:
                    type: string
                    description: Cursor for the previous page (null if first page)
                  has_more:
                    type: boolean
                    description: Whether there are more items available
                description: Cursor-based paginated response wrapper
        '400':
          description: Bad request - validation failed (400)
          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.ValidationError'
        '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.Common.UserId:
      type: string
      minLength: 1
      maxLength: 256
      description: User identifier (pseudonymized for privacy)
    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.ValidationError:
      type: object
      required:
        - title
        - errors
      properties:
        title:
          type: string
          enum:
            - Validation Failed
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Qyl.Common.Errors.ValidationErrorDetail'
          description: List of validation errors
      allOf:
        - $ref: '#/components/schemas/Qyl.Common.Errors.ProblemDetails'
      description: Bad request - validation failed (400)
    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.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.ValidationErrorDetail:
      type: object
      required:
        - field
        - message
        - code
      properties:
        field:
          type: string
          description: The field/property that failed validation
        message:
          type: string
          description: The error message
        code:
          type: string
          description: The validation rule that failed
        rejected_value:
          type: string
          description: The rejected value (if safe to include)
      description: Individual validation error detail
    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

````