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

# Retrieve a session

> Returns focused details on the requested session within an organization's scope.



## OpenAPI

````yaml /en/api-reference/openapi.en-v1.json get /v1/organizations/{organization_id}/sessions/{session_id}
openapi: 3.0.3
info:
  title: Public Portal API
  version: 1.0.0
  description: Public REST API for portal
servers:
  - url: https://api.staging.flxwvdexternal.com
    description: Staging API server.
security:
  - bearerAuth: []
tags: []
paths:
  /v1/organizations/{organization_id}/sessions/{session_id}:
    get:
      tags:
        - Sessions
      summary: Retrieve a session
      description: >-
        Returns focused details on the requested session within an
        organization's scope.
      operationId: get session by id
      parameters:
        - name: organization id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-f]{24}$
            minLength: 24
            maxLength: 24
          description: Organization identifier.
          example: 507f1f77bcf86cd799439011
        - name: session id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            pattern: ^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$
            minLength: 36
            maxLength: 36
          description: Session identifier.
          example: 550E8400-E29B-41D4-A716-446655440000
      responses:
        '200':
          description: Session details retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSessionByIdResponseV1'
              examples:
                session_details:
                  summary: Session detail response
                  value:
                    id: 550E8400-E29B-41D4-A716-446655440000
                    user_name: contoso\jdoe
                    session_type: vdi desktop
                    windows_session_id: 7
                    connection_state: active
                    start_date: '2026-03-15T08:30:00Z'
                    session_status: active notifications
                    platform_type: windows
                    connected: true
                    current_session_id: 41
                    current_dc_name: dc-eu-01
                    last_connection_time: '2026-03-15T09:45:11Z'
                    log_on_duration: 35
                    session_key: 6BA7B810-9DAD-11D1-80B4-00C04FD430C8
                    flexx_analyzer_executed: true
                    cpu_usage: 34.2
                    ram_usage_gb: 3.8
                    rtt_usage: 18.1
                    current_uid_usage: 2.4
                    ram_usage: 3891
                    ram_percentage: 47
                    number_alerts_user: 0
                    number_alerts_vm: 1
                    workspace_id: 64f0c2a1b2d3e4f5060708aa
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_session_id:
                  summary: Invalid session identifier format
                  value:
                    error:
                      message: Invalid session_id format
                      code: bad_request
                      details: >-
                        session_id must be a UUID in uppercase with format
                        8-4-4-4-12
        '401':
          description: Not authorized or organization not accessible.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                organization_not_authorized:
                  summary: Organization access failure
                  value:
                    error:
                      message: Unauthorized
                      code: unauthorized
        '404':
          description: Session not found within the organization's authorized scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                session_not_found:
                  summary: Requested session not found
                  value:
                    error:
                      message: Session not found
                      code: not_found
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unexpected_error:
                  summary: Unhandled failure
                  value:
                    error:
                      message: Internal Server Error
                      code: internal_error
components:
  schemas:
    GetSessionByIdResponseV1:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: ^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$
          minLength: 36
          maxLength: 36
          description: Session identifier.
        user_name:
          type: string
          description: User account for the session.
        session_type:
          type: string
          enum:
            - vdi desktop
            - application
            - sdi_desktop
            - device
          description: Session type.
        windows_session_id:
          type: integer
          description: Windows session identifier.
        connection_state:
          type: string
          enum:
            - unknown
            - connected
            - disconnected
            - terminated
            - preparing_session
            - active
            - reconnecting
            - non_broker_session
            - other
            - pending
          description: State of session connection.
        start_date:
          type: string
          description: Session start timestamp.
        session_status:
          type: string
          nullable: true
          enum:
            - empty
            - active notifications
            - active_notifications_ack_accepted
            - active_notifications_ack_pending
          description: Session status.
        platform_type:
          type: string
          enum:
            - windows
            - mac
            - linux
            - android
            - chrome_os
            - unknown
          description: Platform type.
        connected:
          type: boolean
          description: Indicates if the session is currently connected.
        current_session_id:
          type: integer
          description: Current connection session identifier.
        current_dc_name:
          type: string
          description: Current data center name.
        last_connection_time:
          type: string
          description: Timestamp string of the last connection.
        log_on_duration:
          type: number
          description: Session's login duration.
        session_key:
          type: string
          format: uuid
          pattern: ^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$
          minLength: 36
          maxLength: 36
          description: Session key.
        flexx_analyzer_executed:
          type: boolean
          description: Indicates if the analyzer execution is completed.
        cpu_usage:
          type: number
          nullable: true
          description: Current CPU usage.
        ram_usage_gb:
          type: number
          nullable: true
          description: Current RAM usage in gigabytes.
        rtt_usage:
          type: number
          nullable: true
          description: Current RTT usage.
        current_uid_usage:
          type: number
          nullable: true
          description: Current UID usage.
        ram_usage:
          type: number
          nullable: true
          description: Current RAM usage.
        ram_percentage:
          type: number
          nullable: true
          description: Current RAM usage percentage.
        number_alerts_user:
          type: number
          nullable: true
          description: Number of user alerts.
        number_alerts_vm:
          type: number
          nullable: true
          description: Number of Workspace alerts.
        workspace_id:
          type: string
          nullable: true
          pattern: ^[0-9a-f]{24}$
          minLength: 24
          maxLength: 24
          description: >-
            MongoDB identifier (_id) of the Workspace related to the session,
            resolved from the session relationship.
      required:
        - id
        - user_name
        - session_type
        - windows_session_id
        - connection_state
        - start_date
        - current_session_id
        - current_dc_name
        - last_connection_time
        - log_on_duration
        - session_key
        - connected
        - flexx_analyzer_executed
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
            details:
              type: string
          required:
            - message
            - code
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````