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

# Llistar espais de treball

> Recupera una llista paginada de Workspaces. Admet paginació, ordenació i filtratge mitjançant una cadena de filtre JSON.



## OpenAPI

````yaml /ca/api-reference/openapi.ca-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 per al portal
servers:
  - url: https://api.flexxible.net
    description: Portal API (production)
security:
  - bearerAuth: []
tags: []
paths:
  /v1/organizations/{organization_id}/workspaces:
    get:
      tags:
        - Workspaces
      summary: Llistar espais de treball
      description: >-
        Recupera una llista paginada de Workspaces. Admet paginació, ordenació i
        filtratge mitjançant una cadena de filtre JSON.
      operationId: listWorkspaces
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 24
            pattern: ^[0-9a-f]{24}$
          description: El identificador únic de l'organització
          example: 507f1f77bcf86cd799439011
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
          description: 'Número de pàgina (predeterminat: 1)'
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            default: 100
            maximum: 100
            minimum: 1
          description: 'Elements per pàgina (predeterminat: 100, màx.: 100)'
        - name: sort
          in: query
          required: false
          schema:
            type: string
            pattern: ^([a-z_]+):(asc|desc)$
          description: >-
            Expressió d'ordenació amb el format <field>:asc|desc. En mode
            agregat, només accepta camps de `group_by` o àlies agregats
            (`count`, `<function>_<field>`).
        - name: fields
          in: query
          required: false
          schema:
            type: string
            maxLength: 2048
          description: Llista separada per comes de camps de resposta a incloure.
          example: name,user_name,operating_system
        - name: aggregate
          in: query
          required: false
          schema:
            type: string
            maxLength: 1024
          description: >-
            Agrupa i calcula agregacions sobre Workspaces. Ha de ser enviat com
            cadena JSON amb `group_by` (array de camps de contracte) i
            `aggregates` (array de objectes `{ field, function }`). `field` pot
            ser `"*"` només quan `function` és `"count"`. Valors permesos per a
            `function`: `count`, `sum`, `avg`, `min`, `max`. El paràmetre
            `aggregate` no es pot combinar amb `fields`. En mode agregat, `sort`
            només pot ordenar per camps de `group_by` o per sortides agregades
            (`count`, `function_campo`).
          examples:
            simple:
              summary: Agrupa per estat i compta
              value: >-
                {"group_by":["status"],"aggregates":[{"field":"*","function":"count"}]}
            with-average:
              summary: Agrupa per plataforma i calcula mitjana
              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: >-
            Filtra Workspaces per un o més criteris. Proporciona un objecte JSON
            amb condicions de filtratge. Pots filtrar per qualsevol camp
            retornat en la resposta; usa els mateixos noms de camp i les
            mateixes formes de valor que en la resposta. Usa operadors de
            comparació (eq, ne, gt, gte, lt, lte, in, nin, contains, startsWith,
            endsWith, between) i combina múltiples condicions amb operadors
            lògics (and, or). Longitud màxima: 5120 caràcters.
          examples:
            simple:
              summary: Filtra per nom de Workspace
              description: Torna Workspaces el nom dels quals conté el text proporcionat.
              value: '{"field": "name", "op": "contains", "value": "sdi"}'
            complex-and:
              summary: Filtra per plataforma i estat d'energia
              description: Torna només Workspaces que coincideixen amb ambdues condicions.
              value: >-
                {"and": [{"field": "platform_type", "op": "eq", "value":
                "windows"}, {"field": "power_state", "op": "eq", "value":
                "on"}]}
            complex-or-and:
              summary: Combina condicions OR i AND
              description: >-
                Coincideix amb alternatives de broker i requereix un estat d'EDR
                saludable.
              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: Llista paginada de Workspaces recuperada correctament.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceListResponseV1'
              examples:
                workspace-list:
                  summary: Llista paginada amb un 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: Resultat agregat per estat
                  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: Sol·licitud incorrecta. Paginació, ordenació o filtres no vàlids.
        '401':
          $ref: '#/components/responses/Unauthorized'
          description: No autoritzat - es requereix autenticació
        '404':
          $ref: '#/components/responses/NotFound'
          description: Organització no trobada
        '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: Recurs 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: Estat de l'antivirus.
        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: Tipus 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: Resultat de compliment.
        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: Estat de l'agent 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: Tipus de dispositiu (Virtual/Físic).
        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: Configuració 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: Tipus d'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: Estat de sincronització de configuració d'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: Tipus d'interfície de xarxa.
        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: Tipus 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: Tipus de VM.
        windows_type:
          type: string
          nullable: true
          enum:
            - unknown
            - workstation
            - domain_controller
            - server
          description: Tipus 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: Estat de xifratge del disc dur.
        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: Tipus 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: Estat del FlexxAgent / client 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: Ús de la CPU del Workspace en percentatge.
        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: Estat de l'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: Estat del broker.
        status:
          type: string
          nullable: true
          enum:
            - online
            - offline
          description: Estat de connectivitat del 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: Sol·licitud incorrecta
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: No autoritzat
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: No trobat
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Masses sol·licituds
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Error intern del servidor
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````