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

# Listar espaços de trabalho

> Recupera uma lista paginada de Workspaces. Suporta paginação, ordenação e filtragem através de uma cadeia de filtro JSON.



## OpenAPI

````yaml /pt-BR/api-reference/openapi.pt-v1.json get /v1/organizations/{organization_id}/workspaces
openapi: 3.0.3
info:
  title: API Publica Portal
  version: 1.0.0
  description: API pública REST para portal
servers:
  - url: https://api.flexxible.net
    description: Portal API (production)
security:
  - bearerAuth: []
tags: []
paths:
  /v1/organizations/{organization_id}/workspaces:
    get:
      tags:
        - Workspaces
      summary: Listar espaços de trabalho
      description: >-
        Recupera uma lista paginada de Workspaces. Suporta paginação, ordenação
        e filtragem através de uma cadeia de filtro JSON.
      operationId: listWorkspaces
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 24
            pattern: ^[0-9a-f]{24}$
          description: O identificador único da organização
          example: 507f1f77bcf86cd799439011
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
          description: 'Número da página (padrão: 1)'
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            default: 100
            maximum: 100
            minimum: 1
          description: 'Itens por página (padrão: 100, max.: 100)'
        - name: sort
          in: query
          required: false
          schema:
            type: string
            pattern: ^([a-z_]+):(asc|desc)$
          description: >-
            Expressão de ordenação no formato <field>:asc|desc. No modo
            agregado, só aceita campos de `group_by` ou aliases agregados
            (`count`, `<function>_<field>`).
        - name: fields
          in: query
          required: false
          schema:
            type: string
            maxLength: 2048
          description: Lista separada por vírgulas de campos de resposta a incluir.
          example: name,user_name,operating_system
        - name: aggregate
          in: query
          required: false
          schema:
            type: string
            maxLength: 1024
          description: >-
            Agrupe e calcule agregações sobre Workspaces. Deve ser enviado como
            string JSON com `group_by` (array de campos do contrato) e
            `aggregates` (array de objetos `{ field, function }`). `field` pode
            ser `"*"` somente quando `function` é `"count"`. Valores permitidos
            para `function`: `count`, `sum`, `avg`, `min`, `max`. O parâmetro
            `aggregate` não pode ser combinado com `fields`. No modo agregado,
            `sort` só pode ordenar por campos de `group_by` ou por saídas
            agregadas (`count`, `function_campo`).
          examples:
            simple:
              summary: Agrupar por estado e contar
              value: >-
                {"group_by":["status"],"aggregates":[{"field":"*","function":"count"}]}
            with-average:
              summary: Agrupar por plataforma e calcular média
              value: >-
                {"group_by":["platform_type"],"aggregates":[{"field":"*","function":"count"},{"field":"percent_cpu","function":"avg"}]}
        - name: filters
          in: query
          required: false
          schema:
            type: string
            maxLength: 5120
          description: >-
            Filtre Workspaces por um ou mais critérios. Forneça um objeto JSON
            com condições de filtro. Pode filtrar por qualquer campo retornado
            na resposta; usar os mesmos nomes de campo e formas de valor que na
            resposta. Use operadores de comparação (eq, ne, gt, gte, lt, lte,
            in, nin, contains, startsWith, endsWith, between) e combine
            múltiplas condições com operadores lógicos (and, or). Comprimento
            máximo: 5120 caracteres.
          examples:
            simple:
              summary: Filtrar por nome de Workspace
              description: Retorne Workspaces cujo nome contém o texto fornecido.
              value: '{"field": "name", "op": "contains", "value": "sdi"}'
            complex-and:
              summary: Filtrar por plataforma e estado de energia
              description: Retorne apenas Workspaces que correspondem a ambas as condições.
              value: >-
                {"and": [{"field": "platform_type", "op": "eq", "value":
                "windows"}, {"field": "power_state", "op": "eq", "value":
                "on"}]}
            complex-or-and:
              summary: Combinar condições OU e E
              description: >-
                Corresponde a alternativas de broker e requer um estado de EDR
                saudável.
              value: >-
                {"and": [{"or": [{"field": "broker", "op": "eq", "value":
                "citrix_on-premises"}, {"field": "broker", "op": "eq", "value":
                "azure_virtual_desktop"}]}, {"field": "edr_status", "op": "eq",
                "value": "installed_working"}]}
      responses:
        '200':
          description: Lista paginada de Workspaces recuperada corretamente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceListResponseV1'
              examples:
                workspace-list:
                  summary: Lista paginada com um Workspace
                  value:
                    has_next: false
                    data:
                      - id: 22f5381aa25e89b73785ca34
                        organization_id: 155f78b81155f8ab327ef274
                        name: SDI04-001.org.terravex.net
                        related_environment: 1437d381972ce53252aabe72f053af7c
                        operating_system: Microsoft Windows Server 2022 Standard 21H2
                        serial_number: >-
                          40a70e53327456131ae3321135531ae87f655cbeab27f01134c7ef366a7f2402
                        ip_address: 172.30.113.115
                        os_update_num_pending: 5
                        reporting_group_id: 65f83219942714fc24f01435
                        flxmid: >-
                          50a70e53327456131ae5921135531ae87f639cbe5b27f09034c7ef366a7f2402
                        os_update_num_days_since_last: 183
                        total_ram: 8191
                        altitude: 0
                        antivirus: Windows Defender
                        antivirus_status: installed_working
                        bios_manufacturer: VMware, Inc.
                        bios_mode: UEFI
                        bios_version: P79 Ver. 6.00
                        bios_smbversion: '2.7'
                        bios_serialnumber: VMware-42 06 fd 7c 3a f4 af 1c-97 07 56 e2 07 67 d7 23
                        base_board_manufacturer: Intel Corporation
                        base_board_product: 440BX Desktop Reference Platform
                        base_board_version: A30
                        broker: citrix_on-premises
                        public_ip_city: Barcelona
                        flexxagent_version: 25.9.1.0
                        compliance_result: not_evaluated
                        compliance_last_execution: '2025-06-12T06:13:17.17Z'
                        domain_name: org.terravex.net
                        public_ip_country: ES
                        cores_count: '4'
                        edr_active_detections: false
                        edr_host_id: 11bbcc1e6e2c440aa8b7522a78a292ad
                        edr_status: installed_working
                        edr_version: 7.05.17706.0
                        current_subnet: 172.30.213.0/24
                        default_gateway: 172.30.213.1
                        device_kind: virtual
                        edr: CrowdStrike
                        ema_agent_version: ''
                        ema_endpoint_id: ''
                        embedded_controller_version: '255.255'
                        os_fast_startup: false
                        flexxanalyzer_config: configured
                        flexxanalyzer_version: 3.0.2
                        hypervisor: vmware_vsphere
                        ip_version: IPv4
                        public_ip_isp: Cloudflare, Inc.
                        iot_hub_config_sync_status: synced
                        is_amt_supported: false
                        is_laptop: false
                        is_physical: false
                        last_boot_duration: 20
                        last_restart_time: null
                        last_time: '2025-06-12T06:13:17.17Z'
                        last_windows_update: '2025-09-18T00:00:00.00Z'
                        last_autorepair: '2025-06-10T10:00:00.00Z'
                        latitude: 0
                        locale: English (United States)
                        longitude: 0
                        mac_address: 10-52-56-36-21-42
                        network_interface_type: unknown
                        os_build_number: 6.3.20348.4171
                        os_manufacturer: Microsoft Corporation
                        os_version: 10.0.20348.20348
                        ou: >-
                          OU=NonPersistent,OU=Workstations,OU=OPS914,DC=ops914,DC=terravex,DC=net
                        os_page_file: C:\pagefile.sys
                        os_page_file_space: 512
                        platform_role: Desktop
                        platform_type: windows
                        processor: >-
                          Intel(R) Xeon(R) Gold 6348 CPU @ 2.60GHz, 4 Core(s), 4
                          Logical Processors
                        public_ip: 19.27.129.141
                        os_reboot_pending: false
                        secure_boot_state: 'On'
                        system_model: VMware7,1
                        system_type: x64-based PC
                        os_time_zone: Romance Standard Time
                        user_name: Domain\user001
                        vm_type: workspace
                        windows_type: server
                        create_date: '2023-12-18T11:26:11.11Z'
                        last_deregistration_time: '2026-01-19T12:26:25.25Z'
                        encrypted_harddisks: partial
                        custom_field_01: testVal1
                        custom_field_02: testVal2
                        custom_field_03: '4'
                        custom_field_04: ''
                        custom_field_05: ''
                        custom_field_06: ''
                        custom_field_07: ''
                        custom_field_08: ''
                        custom_field_09: ''
                        custom_field_10: ''
                        flexxagent_type: unified
                        antivirus_version_number: 4.18.2104.5
                        related_location: C08D2228-E80A-4ADA-A75F-03E33E71D119
                        area: Development
                        custom_field_11: ''
                        custom_field_12: ''
                        custom_field_13: ''
                        custom_field_14: ''
                        custom_field_15: ''
                        custom_field_16: ''
                        custom_field_17: ''
                        custom_field_18: ''
                        custom_field_19: ''
                        custom_field_20: ''
                        department: Department
                        office: Office
                        last_custom_fields_update: '2025-12-24T11:24:51.51Z'
                        workspace_id: >-
                          6676aa0c1e9c850250a70e53327456131ae59211aa531ae87f639cbe5b27f09034c7e3366a7f2402
                        flexxanalyzer_proxy_uri: ''
                        iot_hub_name: idIot0e33d84fe5761e
                        flexxagent_status: stopped
                        boot_hard_disk_used_percentage: 34
                        last_connection_time: '2025-06-12T06:13:17.17Z'
                        network_signal: 0
                        num_alerts: 0
                        percent_cpu: 17
                        percent_ram: 0
                        power_state: 'off'
                        sessions_count: 0
                        used_system_disk_c: 34
                        wake_on_lan_mac: 10-50-56-56-51-12
                        wake_on_lan_subnet: 172.30.213.0/24
                        broker_status: disconnected
                        status: offline
                workspace-aggregate:
                  summary: Resultado agregado por estado
                  value:
                    has_next: false
                    data:
                      - status: online
                        count: 120
                        avg_percent_cpu: 17.4
                      - status: offline
                        count: 45
                        avg_percent_cpu: 3.1
        '400':
          $ref: '#/components/responses/BadRequest'
          description: Solicitação incorreta. Paginação, ordenação ou filtros inválidos.
        '401':
          $ref: '#/components/responses/Unauthorized'
          description: Não autorizado - é necessária autenticação
        '404':
          $ref: '#/components/responses/NotFound'
          description: Organização não encontrada
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    WorkspaceListResponseV1:
      type: object
      properties:
        has_next:
          type: boolean
        data:
          type: array
          items:
            $ref: '#/components/schemas/WorkspacePublicV1'
      required:
        - has_next
        - data
    WorkspacePublicV1:
      type: object
      description: Recurso Workspace.
      properties:
        id:
          type: string
          maxLength: 24
          pattern: ^[0-9a-f]{24}$
        organization_id:
          type: string
          nullable: true
          maxLength: 24
          pattern: ^[0-9a-f]{24}$
        name:
          type: string
          nullable: true
        related_environment:
          type: string
          nullable: true
        operating_system:
          type: string
          nullable: true
        serial_number:
          type: string
          nullable: true
        ip_address:
          type: string
          nullable: true
        os_update_num_pending:
          type: number
          nullable: true
        reporting_group_id:
          type: string
          nullable: true
        flxmid:
          type: string
          nullable: true
        os_update_num_days_since_last:
          type: number
          nullable: true
        total_ram:
          type: number
          nullable: true
        altitude:
          type: number
          nullable: true
        antivirus:
          type: string
          nullable: true
        antivirus_status:
          type: string
          nullable: true
          enum:
            - unknown
            - not_installed
            - installed_stopped
            - installed_working
          description: Estado do antivírus.
        bios_manufacturer:
          type: string
          nullable: true
        bios_mode:
          type: string
          nullable: true
        bios_version:
          type: string
          nullable: true
        bios_smbversion:
          type: string
          nullable: true
        bios_serialnumber:
          type: string
          nullable: true
        base_board_manufacturer:
          type: string
          nullable: true
        base_board_product:
          type: string
          nullable: true
        base_board_version:
          type: string
          nullable: true
        broker:
          type: string
          nullable: true
          enum:
            - no_broker_detected
            - azure_virtual_desktop
            - citrix_on-premises
            - citrix_daas
            - amazon_workspaces
            - vmware_horizon
            - parallels_ras
            - windows_365
            - rdsh
            - uds
            - unknown
          description: Tipo de broker.
        public_ip_city:
          type: string
          nullable: true
        flexxagent_version:
          type: string
          nullable: true
        compliance_result:
          type: string
          nullable: true
          enum:
            - not_evaluated
            - compliant
            - not_compliant
          description: Resultado de conformidade.
        compliance_last_execution:
          type: string
          nullable: true
        domain_name:
          type: string
          nullable: true
        public_ip_country:
          type: string
          nullable: true
        cores_count:
          type: string
          nullable: true
        edr_active_detections:
          type: boolean
          nullable: true
        edr_host_id:
          type: string
          nullable: true
        edr_status:
          type: string
          nullable: true
          enum:
            - unknown
            - not_installed
            - installed_stopped
            - installed_working
          description: Estado do agente EDR.
        edr_version:
          type: string
          nullable: true
        current_subnet:
          type: string
          nullable: true
        default_gateway:
          type: string
          nullable: true
        device_kind:
          type: string
          nullable: true
          enum:
            - virtual
            - physical
          description: Tipo de dispositivo (Virtual/Físico).
        edr:
          type: string
          nullable: true
        ema_agent_version:
          type: string
          nullable: true
        ema_endpoint_id:
          type: string
          nullable: true
        embedded_controller_version:
          type: string
          nullable: true
        os_fast_startup:
          type: boolean
          nullable: true
        flexxanalyzer_config:
          type: string
          nullable: true
          enum:
            - not_configured
            - disabled_in_workspace
            - configured
            - installed
            - not_compatible
          description: Configuração de FlexxAnalyzer.
        flexxanalyzer_version:
          type: string
          nullable: true
        hypervisor:
          type: string
          nullable: true
          enum:
            - unknown
            - physical
            - microsoft_azure
            - microsoft_hyper-v
            - vmware_vsphere
            - amazon_web_services
            - nutanix
            - citrix_hypervisor
            - oracle_cloud
            - google_cloud
          description: Tipo de hipervisor.
        ip_version:
          type: string
          nullable: true
        public_ip_isp:
          type: string
          nullable: true
        iot_hub_config_sync_status:
          type: string
          nullable: true
          enum:
            - unknown
            - does_not_apply
            - synced
            - unsynced
          description: Estado de sincronização de configuração do IoT Hub.
        is_amt_supported:
          type: boolean
          nullable: true
        is_laptop:
          type: boolean
          nullable: true
        is_physical:
          type: boolean
          nullable: true
        last_boot_duration:
          type: number
          nullable: true
        last_restart_time:
          type: string
          nullable: true
        last_time:
          type: string
          nullable: true
        last_windows_update:
          type: string
          nullable: true
        last_autorepair:
          type: string
          nullable: true
        latitude:
          type: number
          nullable: true
        locale:
          type: string
          nullable: true
        longitude:
          type: number
          nullable: true
        mac_address:
          type: string
          nullable: true
        network_interface_type:
          type: string
          nullable: true
          enum:
            - unknown
            - ethernet
            - wifi
            - mobile_network
            - other
          description: Tipo de interface de rede.
        os_build_number:
          type: string
          nullable: true
        os_manufacturer:
          type: string
          nullable: true
        os_version:
          type: string
          nullable: true
        ou:
          type: string
          nullable: true
        os_page_file:
          type: string
          nullable: true
        os_page_file_space:
          type: number
          nullable: true
        platform_role:
          type: string
          nullable: true
        platform_type:
          type: string
          nullable: true
          enum:
            - windows
            - mac
            - android
            - linux
            - chromebook
            - ios
            - unknown
          description: Tipo de plataforma.
        processor:
          type: string
          nullable: true
        public_ip:
          type: string
          nullable: true
        os_reboot_pending:
          type: boolean
          nullable: true
        secure_boot_state:
          type: string
          nullable: true
        system_model:
          type: string
          nullable: true
        system_type:
          type: string
          nullable: true
        os_time_zone:
          type: string
          nullable: true
        user_name:
          type: string
          nullable: true
        vm_type:
          type: string
          nullable: true
          enum:
            - hidden
            - workspace_or_avd_session_host
            - desktop_template_definition
            - vcc_role
            - template_definition_surrogate
            - workspace
            - server
            - vdi_appliance
            - application_template_definition
            - application_server
            - endpoint
          description: Tipo de VM.
        windows_type:
          type: string
          nullable: true
          enum:
            - unknown
            - workstation
            - domain_controller
            - server
          description: Tipo de Windows.
        create_date:
          type: string
          nullable: true
        last_deregistration_time:
          type: string
          nullable: true
        encrypted_harddisks:
          type: string
          nullable: true
          enum:
            - 'no'
            - 'yes'
            - partial
            - na
          description: Estado de criptografia do disco rígido.
        custom_field_01:
          type: string
          nullable: true
        custom_field_02:
          type: string
          nullable: true
        custom_field_03:
          type: string
          nullable: true
        custom_field_04:
          type: string
          nullable: true
        custom_field_05:
          type: string
          nullable: true
        custom_field_06:
          type: string
          nullable: true
        custom_field_07:
          type: string
          nullable: true
        custom_field_08:
          type: string
          nullable: true
        custom_field_09:
          type: string
          nullable: true
        custom_field_10:
          type: string
          nullable: true
        flexxagent_type:
          type: string
          nullable: true
          enum:
            - unified
            - mac
            - linux
            - universal
          description: Tipo de FlexxAgent.
        antivirus_version_number:
          type: string
          nullable: true
        related_location:
          type: string
          nullable: true
        area:
          type: string
          nullable: true
        custom_field_11:
          type: string
          nullable: true
        custom_field_12:
          type: string
          nullable: true
        custom_field_13:
          type: string
          nullable: true
        custom_field_14:
          type: string
          nullable: true
        custom_field_15:
          type: string
          nullable: true
        custom_field_16:
          type: string
          nullable: true
        custom_field_17:
          type: string
          nullable: true
        custom_field_18:
          type: string
          nullable: true
        custom_field_19:
          type: string
          nullable: true
        custom_field_20:
          type: string
          nullable: true
        department:
          type: string
          nullable: true
        office:
          type: string
          nullable: true
        last_custom_fields_update:
          type: string
          nullable: true
        workspace_id:
          type: string
          nullable: true
          minLength: 25
          pattern: ^[0-9a-f]{25,}$
        flexxanalyzer_proxy_uri:
          type: string
          nullable: true
        iot_hub_name:
          type: string
          nullable: true
        flexxagent_status:
          type: string
          nullable: true
          enum:
            - unknown
            - working
            - stopped
            - not_reporting
            - service_stopped
            - service_disabled
            - communication_error
            - other_error
            - not_installed
            - update_requested
            - updating
            - update_error
          description: Estado do FlexxAgent / cliente VDI.
        boot_hard_disk_used_percentage:
          type: number
          nullable: true
        last_connection_time:
          type: string
          nullable: true
        network_signal:
          type: number
          nullable: true
        num_alerts:
          type: number
          nullable: true
        percent_cpu:
          type: number
          nullable: true
          description: Uso de CPU do Workspace em porcentagem.
        percent_ram:
          type: number
          nullable: true
        power_state:
          type: string
          nullable: true
          enum:
            - unmanaged
            - unknown
            - dev_express
            - 'off'
            - 'on'
            - suspended
            - turning_on
            - turning_off
            - suspending
            - resuming
            - non_reporting
          description: Estado de energia.
        sessions_count:
          type: number
          nullable: true
        used_system_disk_c:
          type: number
          nullable: true
        wake_on_lan_mac:
          type: string
          nullable: true
        wake_on_lan_subnet:
          type: string
          nullable: true
        broker_status:
          type: string
          nullable: true
          enum:
            - warning
            - other
            - preparing_session
            - connected
            - active
            - disconnected
            - reconnecting
            - non_brokered_session
            - error
            - unmanaged
            - unknown
            - unavailable
            - 'off'
            - 'on'
            - suspended
            - turning_on
            - turning_off
            - suspending
            - resuming
            - not_reporting
            - unregistered
            - available
            - inuse
            - maintenance_or_drain_mode
          description: Estado do broker.
        status:
          type: string
          nullable: true
          enum:
            - online
            - offline
          description: Estado de conectividade do workspace.
      required:
        - id
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
            details:
              type: string
          required:
            - message
            - code
      required:
        - error
  responses:
    BadRequest:
      description: Solicitação incorreta
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Não autorizado
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Não encontrado
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Solicitações em excesso
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Erro interno do servidor
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````