{
  "openapi": "3.0.3",
  "info": {
    "title": "API Publica Portal",
    "version": "2.0.0",
    "description": "API pública REST per al portal"
  },
  "servers": [
    {
      "url": "https://api.flexxible.net",
      "description": "Portal API (production)"
    }
  ],
  "tags": [
    {
      "name": "Activitat digital",
      "description": "Creació de grups de processos core per organització"
    },
    {
      "name": "Roles",
      "description": "Endpoint de creacion de roles de organizacion"
    },
    {
      "name": "Usuarios",
      "description": "Endpoint de creacion de usuarios de organizacion"
    },
    {
      "name": "Grupos de workspaces",
      "description": "Endpoints de gestión de grupos de workspaces"
    },
    {
      "name": "Workspaces",
      "description": "Endpoint de eliminacion de workspaces de la organizacion"
    },
    {
      "name": "Aplicaciones instaladas",
      "description": "Endpoint de detalle de aplicación instalada de la organización"
    },
    {
      "name": "Autenticación",
      "description": "Endpoints de autenticación y contexto de sesión"
    },
    {
      "name": "Microservicios",
      "description": "Detalle de microservicios por organizacion"
    },
    {
      "name": "Operaciones",
      "description": "Consulta de detalle de operaciones por organización"
    },
    {
      "name": "Organización",
      "description": "Operaciones de organización"
    },
    {
      "name": "Objetivos de política de parches",
      "description": "Endpoints de gestión de objetivos de política de parches"
    },
    {
      "name": "Configuraciones de producto",
      "description": "Endpoints de gestión de configuraciones de producto"
    },
    {
      "name": "Grupos de reporte",
      "description": "Operaciones sobre grupos de reporte"
    },
    {
      "name": "Sesiones",
      "description": "Endpoint de detalle de sesion de la organizacion"
    },
    {
      "name": "Tenants",
      "description": "Endpoints de gestión de tenants"
    }
  ],
  "paths": {
    "/v2/organizations/{organization_id}/digital-activity/core-process-groups": {
      "post": {
        "tags": [
          "Activitat digital"
        ],
        "summary": "Crea grup de processos core",
        "operationId": "createDigitalActivityCoreProcessGroup",
        "description": "Crea un grup de processos core en l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDigitalActivityCoreProcessGroupRequestV2"
              },
              "examples": {
                "create_with_description": {
                  "summary": "Crear grup amb descripció",
                  "value": {
                    "name": "Grupo base de productividad",
                    "description": "Grupo principal para procesos de productividad",
                    "workspace_group_id": "64f0c2a1b2d3e4f506070822"
                  }
                },
                "create_without_description": {
                  "summary": "Crear grup sense descripció",
                  "value": {
                    "name": "Grupo de edición",
                    "workspace_group_id": "64f0c2a1b2d3e4f506070823"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Grup de processos core creat correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDigitalActivityCoreProcessGroupResponseV2"
                },
                "examples": {
                  "created": {
                    "summary": "Recurs creat",
                    "value": {
                      "id": "64f0c2a1b2d3e4f506070811",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "name": "Grupo base de productividad",
                      "description": "Grupo principal para procesos de productividad",
                      "workspace_group_id": "64f0c2a1b2d3e4f506070822"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Sol·licitud invàlida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_body": {
                    "summary": "Cos de sol·licitud invàlid",
                    "value": {
                      "error": {
                        "message": "Cuerpo de solicitud inválido",
                        "code": "bad_request",
                        "details": "name y workspace_group_id son obligatorios y deben cumplir el formato esperado."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "L'activitat digital no està habilitada per a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "digital_activity_not_enabled": {
                    "summary": "Activitat digital no habilitada",
                    "value": {
                      "error": {
                        "message": "Digital Activity is not enabled for organization",
                        "code": "forbidden"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs relacionat no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicte de negoci per a la creació del recurs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "duplicate_name": {
                    "summary": "Nom ja registrat",
                    "value": {
                      "error": {
                        "message": "Ya existe un grupo de procesos core con ese nombre",
                        "code": "core_process_group_name_already_exists"
                      }
                    }
                  },
                  "workspace_group_already_assigned": {
                    "summary": "Grup de workspaces ja assignat",
                    "value": {
                      "error": {
                        "message": "El grupo de workspaces ya está asignado a otro grupo de procesos core",
                        "code": "core_process_group_workspace_group_already_assigned"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límit de sol·licituds excedit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Masses sol·licituds",
                    "value": {
                      "error": {
                        "message": "Demasiadas solicitudes",
                        "code": "too_many_requests"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Activitat digital"
        ],
        "summary": "Llistar grups de processos core",
        "operationId": "listDigitalActivityCoreProcessGroups",
        "description": "Retorna una llista paginada de grups de processos core de l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Camps de resposta separats per comes per a cada element.",
            "example": "id,name,workspace_group_id"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió JSON de filtres sobre camps filtrables del recurs.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"core\"}"
              },
              "complex-and": {
                "summary": "Filtrar per organització i grup",
                "value": "{\"and\":[{\"field\":\"organization_id\",\"op\":\"eq\",\"value\":\"507f1f77bcf86cd799439011\"},{\"field\":\"workspace_group_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070822\"}]}"
              },
              "complex-or-and": {
                "summary": "Combinar OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070811\"},{\"field\":\"workspace_group_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070823\"}]},{\"field\":\"name\",\"op\":\"contains\",\"value\":\"group\"}]}"
              }
            }
          },
          {
            "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>`).",
            "example": "organization_id:asc"
          },
          {
            "name": "aggregate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Expressió JSON d'agregació amb 'group_by' i 'aggregates'.",
            "examples": {
              "group-by-workspace-group-count": {
                "summary": "Agrupar per grup de workspaces i comptar",
                "value": "{\"group_by\":[\"workspace_group_id\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}"
              },
              "group-by-organization-avg": {
                "summary": "Agrupar per organització i calcular la mitjana",
                "value": "{\"group_by\":[\"organization_id\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"},{\"field\":\"id\",\"function\":\"min\"}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Grups de processos core recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDigitalActivityCoreProcessGroupsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb resultats",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f506070811",
                          "organization_id": "507f1f77bcf86cd799439011",
                          "name": "Grupo de procesos core A",
                          "description": "Grupo principal de procesos de productividad",
                          "workspace_group_id": "64f0c2a1b2d3e4f506070822"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no válido",
                        "code": "bad_request",
                        "details": "El parámetro filters debe ser una cadena JSON válida."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "L'activitat digital no està habilitada per a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "digital_activity_not_enabled": {
                    "summary": "Activitat digital no habilitada",
                    "value": {
                      "error": {
                        "message": "Digital Activity is not enabled for organization",
                        "code": "forbidden"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límit de sol·licituds excedit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Masses sol·licituds",
                    "value": {
                      "error": {
                        "message": "Demasiadas solicitudes",
                        "code": "too_many_requests"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/flows": {
      "post": {
        "tags": [
          "Fluxos"
        ],
        "summary": "Crea un flux",
        "operationId": "createFlow",
        "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": "Accept-Language",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "en-EN",
                "es-ES",
                "pt-BR",
                "ca-ES",
                "eu-ES"
              ],
              "default": "es-ES"
            },
            "description": "Codi de idioma per a camps de text que admeten diversos idiomes. Al crear o actualitzar recursos, això especifica el idioma dels valors de text proporcionats. Al recuperar recursos, això determina quina variant de idioma dels camps de text multilingües es retorna. Valors acceptats: 'en-EN' (anglès), 'es-ES' (espanyol), 'pt-BR' (portuguès), 'ca-ES' (català), 'eu-ES' (euskera). El valor predeterminat és 'es-ES' si no es proporciona."
          }
        ],
        "responses": {
          "201": {
            "description": "Flux creat correctament. La resposta conté el recurs creat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowV2"
                },
                "example": {
                  "id": "507f1f77bcf86cd799439011"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Falten camps obligatoris - Valors de camp invàlids - Configuració de condició invàlida - Identificador de microservei invàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Organització no trobada"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity",
            "description": "Entitat no processable. Causes comunes: - Microservei referenciat no trobat - Entitats objectiu referenciades (espais de treball, grups d'espais de treball, grups de report) no trobades o no pertanyents - Tipus de condició invàlid - El flux no pot habilitar-se"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFlowV2Request"
              },
              "examples": {
                "create-workspace-flow": {
                  "summary": "Crear un flux dirigit a workspaces específics",
                  "value": {
                    "name": {
                      "en-EN": "Daily Backup Flow",
                      "es-ES": "Proceso de copia diaria"
                    },
                    "description": {
                      "en-EN": "Automated daily backup process",
                      "es-ES": "Proceso automatizado de copia de seguridad diaria"
                    },
                    "type": "workspace",
                    "detection_only": false,
                    "cooldown_minutes": 60,
                    "enabled": false,
                    "init_text": {
                      "en-EN": "Starting backup process...",
                      "es-ES": "Iniciando proceso de copia..."
                    },
                    "ok_text": {
                      "en-EN": "Backup completed successfully",
                      "es-ES": "Copia completada correctamente"
                    },
                    "ko_text": {
                      "en-EN": "Backup failed. Please check logs.",
                      "es-ES": "Copia fallida. Revise los registros."
                    },
                    "target": {
                      "type": "workspaces",
                      "ids": [
                        "507f1f77bcf86cd799439012",
                        "507f1f77bcf86cd799439013"
                      ]
                    },
                    "microservice_id": "507f1f77bcf86cd799439014",
                    "conditions": [
                      {
                        "condition_type_id": "507f1f77bcf86cd799439015",
                        "operator": "gt",
                        "compare_to": "80",
                        "check_every": 300
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "description": "Crea un nou flux d'automatització per a l'organització especificada. El flux defineix la lògica d'execució, les condicions i els workspaces objectius. Retorna les dades del flux creat després d'una creació exitosa."
      },
      "get": {
        "tags": [
          "Fluxos"
        ],
        "summary": "Llistar fluxos",
        "operationId": "listFlows",
        "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": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Camp d'ordenació amb sufix d'ordre opcional (:asc o :desc), p. ex., \"name\", \"name:asc\", \"cooldown_minutes:desc\". Usa ordre ascendent per defecte si no es proporciona sufix. Camps d'ordenació vàlids: id, name, description, type, detection_only, cooldown_minutes, enabled, init_text, ok_text, ko_text"
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Llista separada per comes de camps que s'inclouran en cada element de flux. Camps seleccionables: id, name, description, type, detection_only, cooldown_minutes, enabled. El camp id sempre s'inclou.",
            "example": "name,description,enabled"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120,
              "pattern": "^.*$"
            },
            "description": "Filtra fluxos per un o més criteris. Proporciona un objecte JSON amb condicions de filtre. Pots filtrar per: id, name, description, type, detection_only, cooldown_minutes, enabled, init_text, ok_text, ko_text. 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": "Filtrar per fluxos habilitats",
                "description": "Retorna només fluxos habilitats.",
                "value": "{\"field\": \"enabled\", \"op\": \"eq\", \"value\": true}"
              },
              "complex-and": {
                "summary": "Filtrar per tipus i mode de detecció",
                "description": "Retorna fluxos de SESSIÓ que no són només de detecció.",
                "value": "{\"and\": [{\"field\": \"type\", \"op\": \"eq\", \"value\": \"SESSION\"}, {\"field\": \"detection_only\", \"op\": \"eq\", \"value\": false}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "description": "Coincideix amb múltiples camps de text i requereix fluxos habilitats.",
                "value": "{\"and\": [{\"or\": [{\"field\": \"name\", \"op\": \"contains\", \"value\": \"backup\"}, {\"field\": \"description\", \"op\": \"contains\", \"value\": \"backup\"}]}, {\"field\": \"enabled\", \"op\": \"eq\", \"value\": true}]}"
              }
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 100,
              "minimum": 1
            },
            "description": "Número d'elements per pàgina"
          },
          {
            "name": "Accept-Language",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "en-EN",
                "es-ES",
                "pt-BR",
                "ca-ES",
                "eu-ES"
              ],
              "default": "es-ES"
            },
            "description": "Codi d'idioma per a camps de text que admeten múltiples idiomes. En crear o actualitzar recursos, especifica l'idioma dels valors de text proporcionats. En recuperar recursos, determina quina variant d'idioma dels camps de text multilingües es retorna. Valors acceptats: 'en-EN' (anglès), 'es-ES' (espanyol), 'pt-BR' (portuguès), 'ca-ES' (català), 'eu-ES' (euskera). Usa 'es-ES' per defecte si no es proporciona."
          }
        ],
        "responses": {
          "200": {
            "description": "Llista paginada de fluxos recuperada correctament. La resposta inclou metadats de paginació i l'arranjament de dades de fluxos.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowListItemV2ListResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Paràmetres de paginació no vàlids - Paràmetre de ordenació no vàlid - Paràmetres de filtre 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"
          }
        },
        "description": "Recupera una llista paginada de fluxos pertanyents a l'organització especificada. Admet filtrat, ordenació i cerca en les propietats dels fluxos. Els resultats es tornen en pàgines amb metadats de paginació."
      }
    },
    "/v2/organizations/{organization_id}/operations": {
      "post": {
        "tags": [
          "Operacions"
        ],
        "summary": "Crear operacions",
        "operationId": "createOperations",
        "description": "Crea una o diverses operacions basades en l'abast i els objectius enviats.\n\nTipus d'operació actualment disponibles: `execute_microservice`, `delete_workspaces`, `shutdown_workspaces` i `restart_workspaces`.\n\nRetorna els recursos d'operació creats amb el mateix contracte canònic de consulta per id.\n\n**Compatibilitat de paràmetres per a `execute_microservice`**\n\n`payload.parameters` només aplica a execucions de microserveis PowerShell en Windows i només està suportat en dispositius amb el nou agent instal·lat.\n\nEls valors enviats a `payload.parameters` es transmeten com a text (`string`). La interpretació de tipus depèn de la definició de paràmetres i del parseig implementat en el script del microservei.\n\nPer a aquest context, tipus de dades dels paràmetres recomanats:\n\n- `string`, `integer`, `double`, `decimal` i `datetime`.\n- Per a `double` i `decimal`, useu notació amb punt decimal (`.`).\n- Per a `datetime`, useu el format ISO 8601 (per exemple: `2026-07-09T10:30:00Z`).\n- A l'executar-se al destí, els valors `datetime` es poden representar en hora local.\n- L'execució correcta també depèn de la qualitat i validacions de l'script.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOperationV2Request"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Operacions creades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateOperationV2Response"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "get": {
        "tags": [
          "Operacions"
        ],
        "summary": "Llistar operacions",
        "operationId": "get_operations",
        "description": "Retorna una llista paginada d'operacions de l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Camps de resposta separats per comes per a cada element.",
            "example": "id,organization_id,name,description,status,created_at"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió JSON de filtres sobre camps filtrables del recurs.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"remote\"}"
              },
              "complex-and": {
                "summary": "Filtrar per estat i descripció",
                "value": "{\"and\":[{\"field\":\"status\",\"op\":\"eq\",\"value\":\"finished\"},{\"field\":\"description\",\"op\":\"contains\",\"value\":\"remote\"}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"microservice_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070833\"},{\"field\":\"flow_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070844\"}]},{\"field\":\"status\",\"op\":\"eq\",\"value\":\"pending\"}]}"
              }
            }
          },
          {
            "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>`).",
            "example": "created_at:desc"
          },
          {
            "name": "aggregate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Expressió JSON per a agregació. Estructura: {\"group_by\":[\"field\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}. No es pot combinar amb `fields`.",
            "examples": {
              "group-by-status-count": {
                "summary": "Agrupa per estat i compta",
                "value": "{\"group_by\":[\"status\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}"
              },
              "group-by-organization-count": {
                "summary": "Agrupar per organització i comptar",
                "value": "{\"group_by\":[\"organization_id\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operacions recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOperationsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb resultats",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f506070811",
                          "organization_id": "507f1f77bcf86cd799439022",
                          "name": "remote_assistance",
                          "description": "Remote assistance operation",
                          "status": "finished",
                          "created_at": "2026-03-10T09:11:45Z",
                          "started_at": "2026-03-10T09:12:00Z",
                          "ended_at": "2026-03-10T09:15:17Z",
                          "microservice_id": "64f0c2a1b2d3e4f506070833",
                          "flow_id": "64f0c2a1b2d3e4f506070844",
                          "remote_support": {
                            "start_date": "2026-03-10T09:12:00Z",
                            "end_date": "2026-03-10T09:15:17Z",
                            "type": "unattended"
                          }
                        }
                      ]
                    }
                  },
                  "aggregated_by_status": {
                    "summary": "Resultat agregat per estat",
                    "value": {
                      "has_next": false,
                      "data": [
                        {
                          "status": "finished",
                          "count": 12
                        },
                        {
                          "status": "pending",
                          "count": 5
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no válido",
                        "code": "bad_request",
                        "details": "El parámetro filters debe ser una cadena JSON válida."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/reporting-groups/{reporting_group_id}/magic-links": {
      "post": {
        "tags": [
          "Grups de report"
        ],
        "summary": "Crear un enllaç màgic de descàrrega de l'agent",
        "operationId": "createReportingGroupMagicLink",
        "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": "reporting_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del Grup de report",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReportingGroupMagicLinkRequestV2"
              },
              "examples": {
                "default-installer": {
                  "summary": "Crear enllaç màgic utilitzant valors estrictes de l'instal·lador",
                  "value": {
                    "expires_at": "2026-03-15T12:00:00.000Z",
                    "installer": {
                      "version": "latest",
                      "platform": "windows",
                      "arch": "x64",
                      "type": "fxxone"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Enllaç màgic creat correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateReportingGroupMagicLinkResponseV2"
                },
                "examples": {
                  "created-magic-link": {
                    "summary": "Resposta d'enllaç màgic creat",
                    "value": {
                      "id": "507f1f77bcf86cd799439099",
                      "token": "2ab46558-3c40-4b72-8fce-08b7b596f624",
                      "link": "https://portal.example.com/magic-link?key=2ab46558-3c40-4b72-8fce-08b7b596f624"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta: paràmetres de ruta, cos de sol·licitud o format de data-hora no vàlids."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat: es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup de report no trobat"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity",
            "description": "Entitat no processable: la validació de negoci ha fallat (per exemple, una expiració fora del rang permès)."
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Crea un enllaç màgic per descarregar l'instal·lador de l'agent en un grup de reportatge. Aquesta funcionalitat només està disponible per al producte FXXOne. Posa't en contacte amb l'equip de Flexxible per a més informació."
      }
    },
    "/v2/organizations/{organization_id}/reporting-groups": {
      "post": {
        "tags": [
          "Grups de report"
        ],
        "summary": "Crear un grup de informe",
        "operationId": "createReportingGroup",
        "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"
          }
        ],
        "responses": {
          "201": {
            "description": "Grup de reporte creat correctament. La resposta conté el recurs creat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingGroupByIdV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Falten camps obligatoris (name, product_config_id) - Valors de camp invàlids - Format d'ID invàlid per a camps product_config_id, patch_policy_target_id o intermediate_device_*_id - Valor de fishing_pattern_field invàlid (ha de ser un de: full_name, description, ou, current_subnet) - Valor de fishing_pattern invàlid (excedeix maxLength: 250) - Dispositius intermedis no definits seqüencialment (intermediate_device_2_id requereix intermediate_device_1_id, intermediate_device_3_id requereix intermediate_device_2_id)"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Organització no trobada"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity",
            "description": "Entitat no processable. Causes comunes: - La configuració de producte no s'ha trobat o no pertany a l'organització - Els IDs d'espais de treball de dispositius intermedis no existeixen o no pertanyen a l'organització"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReportingGroupRequestV2"
              },
              "examples": {
                "create-reporting-group-with-minimal-fields": {
                  "summary": "Crear un grup de report només amb els camps obligatoris",
                  "value": {
                    "name": "Grupo de reporte de Producción",
                    "product_config_id": "507f1f77bcf86cd799439030"
                  }
                },
                "create-reporting-group-with-all-fields": {
                  "summary": "Crear un grup de report amb tots els camps disponibles, inclosos dispositius intermedis",
                  "value": {
                    "name": "Grupo de reporte de Desarrollo",
                    "product_config_id": "507f1f77bcf86cd799439030",
                    "patch_policy_target_id": "507f1f77bcf86cd799439040",
                    "fishing_pattern": "Estaciones de trabajo Windows",
                    "fishing_pattern_field": "full_name",
                    "intermediate_device_1_id": "507f1f77bcf86cd799439050",
                    "intermediate_device_2_id": "507f1f77bcf86cd799439051",
                    "intermediate_device_3_id": "507f1f77bcf86cd799439052"
                  }
                },
                "create-reporting-group-with-single-intermediate-device": {
                  "summary": "Crear un grup de report només amb el primer dispositiu intermedi",
                  "value": {
                    "name": "Grupo de reporte de dispositivo único",
                    "product_config_id": "507f1f77bcf86cd799439030",
                    "intermediate_device_1_id": "507f1f77bcf86cd799439050"
                  }
                }
              }
            }
          }
        },
        "description": "Crea un nou grup de reporte per a l'organització especificada. Els grups de reporte s'utilitzen per organitzar i gestionar configuracions de dispositius, ajustaments de producte i polítiques de pedaços. Pots configurar opcionalment dispositius intermedis (fins a 3) proporcionant identificadors de workspace. Els dispositius intermedis s'utilitzen per a accions Wake on LAN en xarxes segures, permetent l'encesa remot de dispositius a través de passarel·les intermediàries. Els dispositius intermedis han de definir-se seqüencialment: no pots definir intermediate_device_2_id sense intermediate_device_1_id, ni intermediate_device_3_id sense intermediate_device_2_id. Tots els IDs de Workspace de dispositius intermedis han d'existir i pertànyer a l'organització. Retorna el ID del grup de reporte creat després d'una creació satisfactòria."
      },
      "get": {
        "tags": [
          "Grups de report"
        ],
        "summary": "Llistar grups d'informe",
        "operationId": "listReportingGroups",
        "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"
            },
            "description": "Número de pàgina (predeterminat: 1)"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Camp d'ordenació amb sufixe d'ordre opcional (:asc o :desc). Camps d'ordenació vàlids: name, organization_id, product_config_id, fishing_pattern, fishing_pattern_field, patch_policy_target_id, policy_reporting_group, overridden_agent_settings.*, effective_agent_settings.*, execute_flexx_analyzer_agent, can_manage_agent_versions, intermediate_device_1_id, intermediate_device_2_id, intermediate_device_3_id. És ascendent de forma predeterminada si no es proporciona sufixe."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Llista separada per comes de camps per incloure a cada element de grup de reporte. Camps seleccionables: id, name, organization_id, product_config_id, fishing_pattern, fishing_pattern_field, patch_policy_target_id, policy_reporting_group, overridden_agent_settings, effective_agent_settings, execute_flexx_analyzer_agent, can_manage_agent_versions, flexx_agent_portal_download, intermediate_device_1_id, intermediate_device_2_id, intermediate_device_3_id. El camp id sempre s'inclou.",
            "example": "name,effective_agent_settings,execute_flexx_analyzer_agent"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120,
              "description": "Filtra grups de report usant un objecte JSON. Especifica el camp a filtrar, l'operador de comparació i el valor. Exemple: {\"field\": \"name\", \"op\": \"eq\", \"value\": \"Grup de report 1\"}",
              "example": "{\"field\": \"name\", \"op\": \"eq\", \"value\": \"Grupo de reporte 1\"}"
            },
            "description": "Filtra grups de report per un o més criteris. Proporciona una cadena JSON amb AST de filtres. Filtra per qualsevol camp retornat en la resposta. Per a camps niats usa notació de punt: overridden_agent_settings.remote_support, effective_agent_settings.remote_support, effective_agent_settings.uninstall_protection, etc. Operadors: eq, ne, gt, gte, lt, lte, in, nin, contains, startsWith, endsWith, between. Combina amb and/or. Longitud màxima: 5120 caràcters.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom del grup de report",
                "description": "Retorna grups d'informes el nom dels quals conté el text proporcionat.",
                "value": "{\"field\": \"name\", \"op\": \"contains\", \"value\": \"producción\"}"
              },
              "complex-and": {
                "summary": "Filtrar per configuració niada i bandera d'execució",
                "description": "Retorna grups on la protecció de desinstal·lació està desactivada i l'execució de l'analitzador està habilitada.",
                "value": "{\"and\": [{\"field\": \"effective_agent_settings.uninstall_protection\", \"op\": \"eq\", \"value\": \"off\"}, {\"field\": \"execute_flexx_analyzer_agent\", \"op\": \"eq\", \"value\": true}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "description": "Coincideix amb múltiples patrons de nom i requereix suport remot interactiu.",
                "value": "{\"and\": [{\"or\": [{\"field\": \"name\", \"op\": \"contains\", \"value\": \"prod\"}, {\"field\": \"name\", \"op\": \"contains\", \"value\": \"stage\"}]}, {\"field\": \"effective_agent_settings.remote_support\", \"op\": \"eq\", \"value\": \"INTERACTIVE\"}]}"
              }
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 100,
              "minimum": 1
            },
            "description": "Número d'elements per pàgina"
          }
        ],
        "responses": {
          "200": {
            "description": "Llista paginada de grups de report recuperada correctament. La resposta inclou metadats de paginació i l'arranjament de dades de grups de report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingGroupListItemV2ListResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Paràmetres de paginació no vàlids - Paràmetre de ordenació no vàlid - Paràmetres de filtre 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"
          }
        },
        "description": "Recupera una llista paginada de grups de report que pertanyen a l'organització especificada. Admet filtrat i ordenació sobre propietats dels grups de report. Els filtres es proporcionen com una cadena JSON seguint l'estructura AST de FilterNode. Els resultats es tornen en pàgines amb metadats de paginació."
      }
    },
    "/v2/organizations/{organization_id}/roles": {
      "post": {
        "tags": [
          "Rols"
        ],
        "summary": "Crear un rol",
        "operationId": "create_role",
        "description": "Crea un rol i les seves entrades de permisos en una sola sol·licitud.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoleRequestV2"
              },
              "examples": {
                "organization_scoped_role": {
                  "summary": "Crear rol amb permís amb abast d'organització",
                  "value": {
                    "name": "Operador de organizacion",
                    "permissions": [
                      {
                        "portal_permission": "organization_admin",
                        "workspaces_permission": "admin_read_only",
                        "analyzer_permission": "access",
                        "target_organization": "507f1f77bcf86cd799439011",
                        "target_reporting_groups": [
                          "64f0c2a1b2d3e4f5060708c1",
                          "64f0c2a1b2d3e4f5060708c2"
                        ]
                      }
                    ]
                  }
                },
                "mixed_permissions_role": {
                  "summary": "Crear rol amb abasts de permisos mixtos",
                  "value": {
                    "name": "Soporte de nivel 1",
                    "permissions": [
                      {
                        "portal_permission": "l1_support_team",
                        "workspaces_permission": "l1_support_team",
                        "analyzer_permission": "no_access",
                        "target_organization": "all",
                        "target_reporting_groups": "all"
                      },
                      {
                        "portal_permission": "l1_support_team_read_only",
                        "workspaces_permission": "l1_support_team_read_only",
                        "analyzer_permission": "access",
                        "target_organization": "507f1f77bcf86cd799439011",
                        "target_reporting_groups": [
                          "64f0c2a1b2d3e4f5060708d1"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Rol d'usuari creat correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleV2"
                },
                "examples": {
                  "created": {
                    "summary": "Rol creat",
                    "value": {
                      "id": "64f0c2a1b2d3e4f5060708aa",
                      "name": "Operador de organizacion",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "created_at": "2026-03-12T10:30:00Z",
                      "created_by": "64f0c2a1b2d3e4f5060708bb",
                      "permissions": [
                        {
                          "portal_permission": "organization_admin",
                          "workspaces_permission": "admin_read_only",
                          "analyzer_permission": "access",
                          "target_organization": "507f1f77bcf86cd799439011",
                          "target_reporting_groups": [
                            "64f0c2a1b2d3e4f5060708c1",
                            "64f0c2a1b2d3e4f5060708c2"
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Càrrega útil de sol·licitud no vàlida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_permission_payload": {
                    "summary": "La càrrega útil de permisos no és vàlida",
                    "value": {
                      "error": {
                        "message": "Cuerpo de solicitud no valido",
                        "code": "bad_request",
                        "details": "permissions[0].target_organization debe ser `all` o una cadena hexadecimal en minusculas de 24 caracteres"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs referenciat no trobat dins l'abast d'organització autoritzat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "reporting_group_not_found": {
                    "summary": "No s'ha trobat el grup de report referenciat",
                    "value": {
                      "error": {
                        "message": "Grupo de reporte no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "La sol·licitud entra en conflicte amb un recurs existent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "role_name_already_exists": {
                    "summary": "El nom del rol ja existeix",
                    "value": {
                      "error": {
                        "message": "El nombre del rol ya existe",
                        "code": "conflict",
                        "details": "name ya esta en uso dentro de esta organizacion"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "La sol·licitud no pot completar-se per restriccions de límit d'entitats de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_entity_limit_exceeded": {
                    "summary": "Límit de rols superat",
                    "value": {
                      "error": {
                        "message": "Entity ownership limit exceeded.",
                        "code": "unprocessable_entity"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Rols"
        ],
        "summary": "Llistar rols",
        "operationId": "get_roles",
        "description": "Retorna una llista paginada de rols disponibles dins de l'àmbit de l'organització.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps de l'element de resposta, separats per comes, que s'han d'incloure."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtres JSON sobre rutes de camps filtrables de la resposta.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom de rol",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"administrador\"}"
              },
              "complex-and": {
                "summary": "Filtrar per tokens combinats del nom del rol",
                "value": "{\"and\":[{\"field\":\"name\",\"op\":\"contains\",\"value\":\"organización\"},{\"field\":\"name\",\"op\":\"contains\",\"value\":\"administrador\"}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"name\",\"op\":\"contains\",\"value\":\"administrador\"},{\"field\":\"name\",\"op\":\"contains\",\"value\":\"operador\"}]},{\"field\":\"name\",\"op\":\"contains\",\"value\":\"rol\"}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(id|organization_id|name|created_at|created_by):(asc|desc)$"
            },
            "description": "Expressió d'ordre en el format <field>:asc|desc."
          }
        ],
        "responses": {
          "200": {
            "description": "Rols recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRolesResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb rols",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f5060708aa",
                          "organization_id": "507f1f77bcf86cd799439011",
                          "name": "Administrador de la organización",
                          "created_at": "2026-03-12T10:30:00Z",
                          "created_by": "64f0c2a1b2d3e4f5060708bb",
                          "permissions": [
                            {
                              "portal_permission": "organization_admin",
                              "workspaces_permission": "admin",
                              "analyzer_permission": "access",
                              "target_organization": "all",
                              "target_reporting_groups": [
                                "64f0c2a1b2d3e4f5060708c1"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No es van trobar rols",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud invàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros inválido",
                        "code": "bad_request",
                        "details": "filters debe ser una cadena JSON válida"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "El recurs sol·licitat no es va trobar dins de l'àmbit de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "resource_not_found": {
                    "summary": "No s'ha trobat el recurs sol·licitat",
                    "value": {
                      "error": {
                        "message": "No encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/tenants": {
      "post": {
        "tags": [
          "Llogaters"
        ],
        "summary": "Crear un arrendatari",
        "operationId": "createTenant",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic de l'organització propietària que crearà el tenant",
            "example": "507f1f77bcf86cd799439011"
          }
        ],
        "responses": {
          "201": {
            "description": "Tenant i organització associats creats correctament. Torna el recurs tenant creat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantByIdV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Cos de sol·licitud o paràmetres de ruta no vàlids - S'han barrejat configuracions excloents (`tenant_config` i `organization_config`) - Falta de camps obligatoris per al tipus seleccionat - Format d'id no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "No s'ha trobat l'organització propietària"
          },
          "422": {
            "description": "Entitat no processable - Error de validació de lògica de negoci. Causes comunes: - Product config no trobat - L'organització no és elegible per crear tenants - L'organització no existeix en build - L'organització no té productes elegibles - Relació de partner no vàlida - L'organització i l'organització pare són clients finals - Entitat referenciada no trobada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantRequestV2"
              },
              "examples": {
                "create-tenant-end-customer": {
                  "summary": "Crear tenant per organització END CUSTOMER",
                  "value": {
                    "type": "tenant",
                    "name": "Tenant de producción",
                    "tenant_config": {
                      "product_config_id": "507f1f77bcf86cd799439030",
                      "analyzer": "existing"
                    },
                    "policy_id": "507f1f77bcf86cd799439050",
                    "organization_email": "tenant@example.com",
                    "organization_language": "en",
                    "organization_country": "US",
                    "organization_industry": "Tecnología"
                  }
                },
                "create-tenant-partner-or-wholesaler": {
                  "summary": "Crear tenant per organització PARTNER o WHOLESALER",
                  "value": {
                    "type": "organization",
                    "name": "Tenant empresarial",
                    "organization_config": {
                      "product_id": "507f1f77bcf86cd799439030",
                      "region": "west-eu-01_one"
                    },
                    "policy_id": "507f1f77bcf86cd799439050",
                    "organization_email": "enterprise@example.com",
                    "organization_language": "es",
                    "organization_country": "ES",
                    "organization_industry": "Finanzas"
                  }
                }
              }
            }
          }
        },
        "description": "Crea un nou tenant i una organització associada per a l'organització propietària especificada. El cos de sol·licitud utilitza un discriminador `type` amb rutes excloents: `tenant` (END CUSTOMER) i `organization` (PARTNER/WHOLESALER)."
      },
      "get": {
        "tags": [
          "Llogaters"
        ],
        "summary": "Llistar arrendataris",
        "operationId": "listTenants",
        "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,
              "minimum": 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": "Número d'elements per pàgina"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Camp d'ordenació amb sufix opcional d'ordre (:asc o :desc), p. ex., \"name\", \"name:asc\", \"created_at:desc\". Usa ordre ascendent de forma predeterminada si no es proporciona sufix. Camps vàlids: id, created_at, name, region, product_id, policy_id"
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Llista separada per comes de camps per incloure en cada element de tenant. Camps seleccionables: id, organization_id, created_at, name, region, product_id, policy_id. El camp id sempre s'inclou.",
            "example": "name,region,product_id"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120,
              "description": "Filtra tenants usant un objecte JSON. Especifica el camp a filtrar, l'operador de comparació i el valor. Exemple: {\"field\": \"name\", \"op\": \"eq\", \"value\": \"Tenant 1\"}",
              "example": "{\"field\": \"name\", \"op\": \"eq\", \"value\": \"Tenant 1\"}"
            },
            "description": "Filtra tenants per un o més criteris. Proporciona un objecte JSON amb condicions de filtratge. Pots filtrar per qualsevol camp retornat en la resposta. Usa operadors de comparació (eq, ne, gt, gte, lt, lte, in, nin, contains, startsWith, endsWith, between) i combina diverses condicions amb operadors lògics (and, or). Longitud màxima: 5120 caràcters.",
            "examples": {
              "simple": {
                "summary": "Filtre simple",
                "description": "Filtra tenants per nom que conté text.",
                "value": "{\"field\": \"name\", \"op\": \"contains\", \"value\": \"production\"}"
              },
              "complex-and": {
                "summary": "Filtre complex amb AND",
                "description": "Filtra tenants per regió i producte al mateix temps.",
                "value": "{\"and\": [{\"field\": \"region\", \"op\": \"eq\", \"value\": \"us-east\"}, {\"field\": \"product_id\", \"op\": \"eq\", \"value\": \"507f1f77bcf86cd799439030\"}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "description": "Coincideix amb múltiples regions i aplica una restricció de nom.",
                "value": "{\"and\": [{\"or\": [{\"field\": \"region\", \"op\": \"eq\", \"value\": \"us-east\"}, {\"field\": \"region\", \"op\": \"eq\", \"value\": \"eu-west\"}]}, {\"field\": \"name\", \"op\": \"contains\", \"value\": \"tenant\"}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Llista paginada de tenants recuperada correctament. La resposta inclou la bandera de paginació i l'arranjament de dades de tenants.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantListItemV2ListResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Paràmetres de paginació no vàlids - Paràmetre de ordenació no vàlid - Paràmetres de filtre 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"
          }
        },
        "description": "Recupera una llista paginada de tenants que pertanyen a l'organització especificada. Suport filtratge i ordenació sobre propietats del tenant. Els filtres es proporcionen com una cadena JSON que segueix l'estructura AST de FilterNode. Els resultats es retornen en pàgines amb metadades de paginació."
      }
    },
    "/v2/organizations/{organization_id}/users": {
      "post": {
        "tags": [
          "Usuaris"
        ],
        "summary": "Crear un usuari",
        "operationId": "create_user",
        "description": "Crea un nou usuari dins l'abast de l'organització.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequestV2"
              },
              "examples": {
                "standard_user": {
                  "summary": "Crear un usuari estàndard",
                  "value": {
                    "name": "Ana",
                    "surname": "Lopez",
                    "email": "ana.lopez@example.com",
                    "language": "en-EN",
                    "role_id": "64f0c2a1b2d3e4f5060708aa",
                    "department": "Support",
                    "email_login_enabled": false
                  }
                },
                "email_login_user": {
                  "summary": "Crear un usuari amb inici de sessió per correu electrònic habilitat",
                  "value": {
                    "name": "Diego",
                    "surname": "Santos",
                    "email": "diego.santos@example.com",
                    "language": "es-ES",
                    "role_id": "64f0c2a1b2d3e4f5060708ab",
                    "email_login_enabled": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Usuari creat correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserByIdV2"
                },
                "examples": {
                  "created": {
                    "summary": "Usuari creat",
                    "value": {
                      "id": "64f0c2a1b2d3e4f506070801",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "name": "Ana",
                      "surname": "Lopez",
                      "email": "ana.lopez@example.com",
                      "language": "en-EN",
                      "created_at": "2026-06-22T16:00:00.000Z",
                      "department": "Support",
                      "role_id": "64f0c2a1b2d3e4f5060708aa",
                      "created_by": "64f0c2a1b2d3e4f5060708bb",
                      "email_login_enabled": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Càrrega útil de sol·licitud no vàlida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_email": {
                    "summary": "El format del correu electrònic no és vàlid",
                    "value": {
                      "error": {
                        "message": "Cuerpo de solicitud no valido",
                        "code": "bad_request",
                        "details": "email debe ser una direccion valida"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No s'ha trobat el recurs referenciat dins l'abast de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "user_role_not_found": {
                    "summary": "No s'ha trobat el rol d'usuari",
                    "value": {
                      "error": {
                        "message": "Rol de usuario no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "La sol·licitud entra en conflicte amb un recurs existent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "email_already_exists": {
                    "summary": "El correu electrònic ja existeix",
                    "value": {
                      "error": {
                        "message": "El correo electronico ya existe",
                        "code": "conflict",
                        "details": "email ya esta registrado"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Usuaris"
        ],
        "summary": "Llistar usuaris",
        "operationId": "get_users",
        "description": "Retorna una llista paginada d'usuaris disponibles dins de l'àmbit de l'organització.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps d'elements de resposta separats per comes per incloure."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre rutes de camps de resposta filtrables. Tots els camps del contracte són filtrables.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom d'usuari",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"ana\"}"
              },
              "complex-and": {
                "summary": "Filtrar per departament i mètode d'inici de sessió",
                "value": "{\"and\":[{\"field\":\"department\",\"op\":\"eq\",\"value\":\"support\"},{\"field\":\"email_login_enabled\",\"op\":\"eq\",\"value\":true}]}"
              },
              "complex-or-and": {
                "summary": "Combinar filtrat per organització i correu electrònic",
                "value": "{\"and\":[{\"or\":[{\"field\":\"organization_id\",\"op\":\"eq\",\"value\":\"507f1f77bcf86cd799439011\"},{\"field\":\"organization_id\",\"op\":\"eq\",\"value\":\"507f1f77bcf86cd799439012\"}]},{\"field\":\"email\",\"op\":\"contains\",\"value\":\"@example.com\"}]}"
              },
              "created-at-and-role": {
                "summary": "Filtrar per data de creació i rol",
                "value": "{\"and\":[{\"field\":\"created_at\",\"op\":\"gte\",\"value\":\"2025-01-01T00:00:00.000Z\"},{\"field\":\"role_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f5060708aa\"}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(id|name|surname|email|language|department|role_id|organization_id|created_at|created_by|email_login_enabled):(asc|desc)$"
            },
            "description": "Expressió d'ordre en el format <field>:asc|desc. Tots els camps del contracte són ordenables."
          }
        ],
        "responses": {
          "200": {
            "description": "Usuaris recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetUsersResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb usuaris",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f506070801",
                          "name": "Ana",
                          "surname": "Lopez",
                          "email": "ana.lopez@example.com",
                          "language": "en-EN",
                          "department": "Support",
                          "role_id": "64f0c2a1b2d3e4f5060708aa",
                          "organization_id": "507f1f77bcf86cd799439011",
                          "created_at": "2025-12-01T10:30:00.000Z",
                          "created_by": "64f0c2a1b2d3e4f5060708bb",
                          "email_login_enabled": true
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No es van trobar usuaris",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de solicitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no valido",
                        "code": "bad_request",
                        "details": "filters debe ser una cadena JSON valida"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs sol·licitat no trobat dins l'àmbit autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "resource_not_found": {
                    "summary": "El recurs sol·licitat no es va trobar",
                    "value": {
                      "error": {
                        "message": "No encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/workspace-groups/{workspace_group_id}/schedules": {
      "post": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Crear una programació cron",
        "operationId": "createWorkspaceGroupSchedule",
        "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": "workspace_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de workspaces",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "201": {
            "description": "Programació creada correctament. La resposta conté el recurs de programació creat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceGroupScheduleV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Falten camps obligatoris (cron_expression, time_zone, type) - Format d'expressió cron invàlid - Valor de zona horària invàlid - Tipus de programació invàlid (ha de ser START, STOP o RESTART) - Format d'ID d'espai de treball de intermediate_device invàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat: l'usuari no té accés a l'organització o l'organització no existeix"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup d'espais de treball no trobat o el grup d'espais de treball pertany a una organització diferent (després de passar l'autorització)"
          },
          "409": {
            "$ref": "#/components/responses/Conflict",
            "description": "Conflicte: ja existeix una programació amb el mateix tipus, hora i dia (després de la conversió de zona horària)"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity",
            "description": "Entitat no processable. Causes comunes: - L'ID d'espai de treball de intermediate_device no existeix o no pertany a l'organització"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkspaceGroupScheduleRequestV2"
              },
              "examples": {
                "create-start-schedule": {
                  "summary": "Crear una programació START per a dies laborables a les 8 AM",
                  "value": {
                    "cron_expression": "0 8 * * 1-5",
                    "time_zone": "Eastern Standard Time",
                    "type": "start"
                  }
                },
                "create-start-schedule-with-intermediate-device": {
                  "summary": "Crear una programació START amb dispositiu intermedi per a Wake-on-LAN",
                  "value": {
                    "cron_expression": "0 8 * * 1-5",
                    "time_zone": "Eastern Standard Time",
                    "type": "start",
                    "intermediate_device": "507f1f77bcf86cd799439050"
                  }
                },
                "create-stop-schedule": {
                  "summary": "Crear una programació STOP per a dies laborables a les 6 PM",
                  "value": {
                    "cron_expression": "0 18 * * 1-5",
                    "time_zone": "UTC",
                    "type": "stop"
                  }
                },
                "create-restart-schedule": {
                  "summary": "Crear una programació RESTART per a caps de setmana a mitjanit",
                  "value": {
                    "cron_expression": "0 0 * * 0,6",
                    "time_zone": "Pacific Standard Time",
                    "type": "restart"
                  }
                }
              }
            }
          }
        },
        "description": "Crea una nova programació cron per a un grup de workspaces. Les programacions defineixen operacions automatitzades d'energia (START, STOP, RESTART) que es executen en programacions especificades segons expressions cron i zona horària. Les programacions START poden incloure opcionalment un ID de Workspace de dispositiu intermedi per operacions Wake on LAN en xarxes segures. Si es proporciona intermediate_device, indica que s'ha d'utilitzar un dispositiu intermedi. El sistema valida que no existeixi una programació en conflicte (mateix tipus, hora i dia després de la conversió de zona horària)."
      },
      "get": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Llistar programacions cron",
        "operationId": "listWorkspaceGroupSchedules",
        "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": "workspace_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de workspaces",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "200": {
            "description": "Llista de programacions recuperada correctament. Torna un arranjament d'objectes de programació. Arranjament buit si no existeixen programacions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceGroupScheduleV2ListResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta: format d'ID de grup d'espais de treball no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat: l'usuari no té accés a l'organització o l'organització no existeix"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup d'espais de treball no trobat o el grup d'espais de treball pertany a una organització diferent (després de que l'autorització es validi)"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Recupera totes les programacions cron configurades per a un grup de workspaces. Torna un arranjament d'objectes de programació que contenen expressió cron, zona horària, tipus, informació del dispositiu intermedi i metadats d'auditoria. Si el grup de workspaces no té programacions, es torna un arranjament buit."
      }
    },
    "/v2/organizations/{organization_id}/workspace-groups": {
      "post": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Crear un grup de workspaces",
        "operationId": "createWorkspaceGroup",
        "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"
          }
        ],
        "responses": {
          "201": {
            "description": "Grup de workspaces creat correctament. La resposta conté el recurs creat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceGroupDetailResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Falten camps obligatoris - Valors de camp no vàlids - Valor de tipus no vàlid (només es permet STATIC) - Estructura de localització no vàlida"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Organització no trobada"
          },
          "409": {
            "$ref": "#/components/responses/Conflict",
            "description": "Conflicte: ja existeix un grup de workspaces amb el mateix nom"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspacegroupsCreateRequestV2"
              },
              "examples": {
                "create-static-workspace-group": {
                  "summary": "Crear un grup de workspaces amb els camps obligatoris mínims",
                  "value": {
                    "name": "Grupo de Workspaces de producción"
                  }
                },
                "create-workspace-group-with-description": {
                  "summary": "Crear un grup de workspaces amb descripció",
                  "value": {
                    "name": "Grupo de Workspaces de desarrollo",
                    "description": "Grupo de workspaces para entornos de desarrollo",
                    "type": "static"
                  }
                },
                "create-workspace-group-with-location": {
                  "summary": "Crear un grup de workspaces amb informació de ubicació",
                  "value": {
                    "name": "Grupo de Workspaces de la oficina de Madrid",
                    "description": "Grupo de workspaces para la oficina de Madrid",
                    "type": "static",
                    "location": {
                      "latitude": 40.4168,
                      "longitude": -3.7038,
                      "address": "Madrid, España",
                      "description": "Ubicación de la oficina principal"
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Crea un nou grup de workspaces per a l'organització especificada. Actualment només s'admeten grups de workspaces de tipus STATIC. Retorna l'ID del grup de workspaces creat després d'una creació exitosa."
      },
      "get": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Llistar grups d'espais de treball",
        "operationId": "listWorkspaceGroups",
        "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": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Camp d'ordenació amb sufix opcional d'ordre (:asc o :desc). Camps d'ordenació vàlids: id, name, description, created_by, created_at, type, location. L'ordre ascendent s'utilitza per defecte si no es proporciona sufix."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Llista separada per comes de camps per incloure en cada element de grups de workspaces. Camps seleccionables: id, name, description, organization_id, created_by, created_at, type, filter, location, entra_id_source. El camp id sempre s'inclou.",
            "example": "name,type,created_at"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120,
              "description": "Filtrar grups de workspaces usant un objecte JSON. Especifica el camp a filtrar, l'operador de comparació i el valor. Exemple: {\"field\": \"name\", \"op\": \"eq\", \"value\": \"grups de workspaces 1\"}",
              "example": "{\"field\": \"name\", \"op\": \"eq\", \"value\": \"Grupo de Workspace 1\"}"
            },
            "description": "Filtrar grups de workspaces per un o més criteris. Proporciona un objecte JSON amb condicions de filtratge. Pots filtrar per: id, name, description, created_by, created_at, type, location, entra_id_source.resource_id, entra_id_source.resource_type, entra_id_source.resource_name. Per a camps anidats com location o entra_id_source, utilitza notació per punts (ex., location.latitude, entra_id_source.resource_type). Utilitza 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 grups de workspaces",
                "description": "Torna grups de workspaces el nom dels quals conté el text proporcionat.",
                "value": "{\"field\": \"name\", \"op\": \"contains\", \"value\": \"finanzas\"}"
              },
              "complex-and": {
                "summary": "Filtra per tipus i ubicació",
                "description": "Torna grups de workspaces STATIC per sobre d'un llindar de latitud.",
                "value": "{\"and\": [{\"field\": \"type\", \"op\": \"eq\", \"value\": \"STATIC\"}, {\"field\": \"location.latitude\", \"op\": \"gt\", \"value\": 40}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "description": "Coincideix amb múltiples patrons de nom i requereix un tipus de recurs d'Entra específic.",
                "value": "{\"and\": [{\"or\": [{\"field\": \"name\", \"op\": \"contains\", \"value\": \"Finanzas\"}, {\"field\": \"name\", \"op\": \"contains\", \"value\": \"RRHH\"}]}, {\"field\": \"entra_id_source.resource_type\", \"op\": \"eq\", \"value\": \"GROUP\"}]}"
              }
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 100,
              "minimum": 1
            },
            "description": "Número d'elements per pàgina"
          }
        ],
        "responses": {
          "200": {
            "description": "Llista paginada de grups de workspaces recuperada correctament. La resposta inclou metadats de paginació i un arranjament de dades de grups de workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceGroupListItemV2ListResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Paràmetres de paginació no vàlids - Paràmetre de ordenació no vàlid - Paràmetres de filtratge 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"
          }
        },
        "description": "Recupera una llista paginada de grups de workspaces que pertanyen a l'organització especificada. Admet filtrat i ordenació sobre propietats de grups de workspaces. Els filtres es proporcionen com una cadena JSON seguint l'estructura AST de FilterNode. Els resultats es tornen en pàgines amb metadats de paginació."
      }
    },
    "/v2/organizations/{organization_id}/digital-activity/core-process-groups/{id}": {
      "delete": {
        "tags": [
          "Activitat digital"
        ],
        "summary": "Eliminar grup de processos core",
        "operationId": "deleteDigitalActivityCoreProcessGroup",
        "description": "Elimina un grup de processos core dins de l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del grup de processos core.",
            "example": "64f0c2a1b2d3e4f506070811"
          }
        ],
        "responses": {
          "204": {
            "description": "Grup de processs core eliminat correctament. No es torna a mostrar contingut."
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_path_params": {
                    "summary": "Format d'identificadors invàlid",
                    "value": {
                      "error": {
                        "message": "Parámetros de ruta no válidos",
                        "code": "bad_request",
                        "details": "organization_id e id deben tener 24 caracteres hexadecimales."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "L'activitat digital no està habilitada per a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "digital_activity_not_enabled": {
                    "summary": "Activitat digital no habilitada",
                    "value": {
                      "error": {
                        "message": "Digital Activity is not enabled for organization",
                        "code": "forbidden"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límit de sol·licituds excedit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Masses sol·licituds",
                    "value": {
                      "error": {
                        "message": "Demasiadas solicitudes",
                        "code": "too_many_requests"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/flows/{flow_id}": {
      "delete": {
        "tags": [
          "Fluxos"
        ],
        "summary": "Eliminar un flux",
        "operationId": "deleteFlow",
        "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": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del flux que s'eliminarà",
            "example": "507f1f77bcf86cd799439012"
          }
        ],
        "responses": {
          "204": {
            "description": "Flux eliminat correctament. No retorna contingut."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta - ID de flux no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - autenticació requerida"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Flux no trobat"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Elimina de forma permanent un flux de l'organització. Aquesta acció no es pot desfer. No retorna contingut (204) després d'una eliminació correcta."
      },
      "get": {
        "tags": [
          "Fluxos"
        ],
        "summary": "Recuperar un flux",
        "operationId": "getFlowById",
        "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": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del flux",
            "example": "507f1f77bcf86cd799439012"
          },
          {
            "name": "Accept-Language",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "en-EN",
                "es-ES",
                "pt-BR",
                "ca-ES",
                "eu-ES"
              ],
              "default": "es-ES"
            },
            "description": "Codi de idioma per a camps de text que admeten diversos idiomes. Al crear o actualitzar recursos, això especifica el idioma dels valors de text proporcionats. Al recuperar recursos, això determina quina variant de idioma dels camps de text multilingües es retorna. Valors acceptats: 'en-EN' (anglès), 'es-ES' (espanyol), 'pt-BR' (portuguès), 'ca-ES' (català), 'eu-ES' (euskera). El valor predeterminat és 'es-ES' si no es proporciona."
          }
        ],
        "responses": {
          "200": {
            "description": "Detalls del flux recuperats correctament. La resposta inclou la configuració completa del flux, condicions, destinacions i mètriques d'execució.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta - ID de flux no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Flux no trobat"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Recupera informació detallada sobre un flux específic, inclosa la seva configuració, lògica d'execució, condicions, destinacions i mètriques d'execució. Retorna les dades completes del flux en el idioma sol·licitat."
      },
      "put": {
        "tags": [
          "Fluxos"
        ],
        "summary": "Actualitzar un flux",
        "operationId": "updateFlow",
        "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": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del flux a actualitzar",
            "example": "507f1f77bcf86cd799439012"
          },
          {
            "name": "Accept-Language",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "en-EN",
                "es-ES",
                "pt-BR",
                "ca-ES",
                "eu-ES"
              ],
              "default": "es-ES"
            },
            "description": "Codi de idioma per a camps de text que admeten diversos idiomes. Al crear o actualitzar recursos, això especifica el idioma dels valors de text proporcionats. Al recuperar recursos, això determina quina variant de idioma dels camps de text multilingües es retorna. Valors acceptats: 'en-EN' (anglès), 'es-ES' (espanyol), 'pt-BR' (portuguès), 'ca-ES' (català), 'eu-ES' (euskera). El valor predeterminat és 'es-ES' si no es proporciona."
          }
        ],
        "responses": {
          "200": {
            "description": "Flux actualitzat correctament. La resposta conté el recurs actualitzat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Falten camps obligatoris - Valors de camp no vàlids - Configuració de condició no vàlida - Identificador de microservei no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - autenticació requerida"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Flux o organització no trobats"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity",
            "description": "Entitat no processable. Causes comunes: - Microservei referenciat no trobat - Entitats objectiu referenciades (Espais de treball, Grups d'espais de treball, Grups de report) no trobades o no pertanyents - Tipus de condició no vàlid - El flux no es pot habilitar"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFlowV2Request"
              },
              "examples": {
                "update-flow-configuration": {
                  "summary": "Actualitza flux amb nova configuració",
                  "value": {
                    "name": {
                      "en-EN": "Flujo diario de copia actualizado",
                      "es-ES": "Proceso de copia diaria actualizado"
                    },
                    "description": {
                      "en-EN": "Proceso automatizado de copia diaria actualizado",
                      "es-ES": "Proceso automatizado de copia actualizado"
                    },
                    "detection_only": false,
                    "cooldown_minutes": 120,
                    "enabled": true,
                    "init_text": {
                      "en-EN": "Iniciando proceso de copia actualizado...",
                      "es-ES": "Iniciando proceso de copia actualizado..."
                    },
                    "ok_text": {
                      "en-EN": "Copia completada correctamente"
                    },
                    "ko_text": {
                      "en-EN": "La copia fallo. Por favor, revisa los registros."
                    },
                    "target": {
                      "type": "workspaces",
                      "ids": [
                        "507f1f77bcf86cd799439012",
                        "507f1f77bcf86cd799439013"
                      ]
                    },
                    "microservice_id": "507f1f77bcf86cd799439014",
                    "conditions": [
                      {
                        "condition_type_id": "507f1f77bcf86cd799439015",
                        "operator": "gte",
                        "compare_to": "90",
                        "period": null,
                        "check_every": 600
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "description": "Actualitza la configuració d'un flux existent, incloent nom, descripció, lògica d'execució, condicions i configuració de destí. Retorna el recurs actualitzat (200) després d'una actualització correcta."
      }
    },
    "/v2/organizations/{organization_id}/reporting-groups/{reporting_group_id}": {
      "delete": {
        "tags": [
          "Grups de report"
        ],
        "summary": "Eliminar un grup de report",
        "operationId": "deleteReportingGroup",
        "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": "reporting_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de report que s'eliminarà",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "204": {
            "description": "Grup de report eliminat correctament. No retorna contingut."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Paràmetres de ruta no vàlids - Format d'ID no vàlid per a organization_id o reporting_group_id"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup de report no trobat o no pertany a l'organització"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Elimina un grup de report existent de l'organització. El grup de report no ha de tenir Workspaces assignats i ha de ser directament editable. No retorna contingut (204) després d'una eliminació exitosa."
      },
      "get": {
        "tags": [
          "Grups de report"
        ],
        "summary": "Recuperar un grup d'informe",
        "operationId": "getReportingGroupById",
        "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": "reporting_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de report",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalls del grup de report recuperats correctament. La resposta inclou la configuració del grup de report i els ajustos de l'agent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingGroupByIdV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta - format d'ID de grup de report no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - autenticació requerida"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup de report no trobat o no pertany a l'organització"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Recupera informació detallada sobre un grup de report específic, inclosa la seva configuració i els ajustos de l'agent. Retorna dades del grup de report que coincideixen amb l'estructura del endpoint de llistat."
      },
      "put": {
        "tags": [
          "Grups de report"
        ],
        "summary": "Actualitzar un grup d'informe",
        "operationId": "updateReportingGroup",
        "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": "reporting_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de report a actualitzar",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "200": {
            "description": "Grup de reporte actualitzat correctament. La resposta conté el recurs actualitzat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingGroupByIdV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Falten camps obligatoris (name) - Valors de camp no vàlids - Valor de fishing_pattern_field no vàlid (ha de ser un de: full_name, description, ou, current_subnet) - Valor de fishing_pattern no vàlid (supera maxLength: 250) - Format d'ID no vàlid per als camps patch_policy_target_id o intermediate_device_*_id - Dispositius intermedis no definits seqüencialment (intermediate_device_2_id requereix intermediate_device_1_id, intermediate_device_3_id requereix intermediate_device_2_id)"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - autenticació requerida"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "No trobat. Causes comunes: - Grup de report no trobat o que no pertany a l'organització - Destí de política de parches no trobat"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity",
            "description": "Entitat no processable. Causes comunes: - Els IDs d'espais de treball de dispositius intermedis no existeixen o no pertanyen a l'organització"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReportingGroupRequestV2"
              },
              "examples": {
                "update-reporting-group-full-replacement": {
                  "summary": "Actualitza grup de report amb tots els camps actualitzables, inclosos els dispositius intermedis",
                  "value": {
                    "name": "Grupo de reporte de producción actualizado",
                    "description": "Grupo de reporte actualizado para entornos de producción",
                    "patch_policy_target_id": "507f1f77bcf86cd799439040",
                    "fishing_pattern": "Estaciones de trabajo Windows",
                    "fishing_pattern_field": "full_name",
                    "intermediate_device_1_id": "507f1f77bcf86cd799439050",
                    "intermediate_device_2_id": "507f1f77bcf86cd799439051",
                    "intermediate_device_3_id": "507f1f77bcf86cd799439052"
                  }
                },
                "update-reporting-group-minimal-fields": {
                  "summary": "Actualitza grup de report només amb els camps obligatoris (neteja tots els camps opcionals)",
                  "value": {
                    "name": "Nombre actualizado del grupo de reporte"
                  },
                  "description": "Aquest exemple mostra l'actualització només del nom. Tots els camps opcionals (description, patch_policy_target_id, fishing_pattern, fishing_pattern_field i dispositius intermedis) s'esborraran."
                },
                "update-reporting-group-with-single-intermediate-device": {
                  "summary": "Actualitza grup de report només amb el primer dispositiu intermedi",
                  "value": {
                    "name": "Nombre actualizado del grupo de reporte",
                    "description": "Configuración de un solo dispositivo intermedio",
                    "intermediate_device_1_id": "507f1f77bcf86cd799439050"
                  },
                  "description": "Aquest exemple estableix només intermediate_device_1_id. intermediate_device_2_id i intermediate_device_3_id es netejaran si estaven establerts prèviament."
                },
                "update-reporting-group-clear-intermediate-devices": {
                  "summary": "Actualitza grup de report i neteja tots els dispositius intermedis",
                  "value": {
                    "name": "Nombre actualizado del grupo de reporte",
                    "description": "Sin dispositivos intermedios"
                  },
                  "description": "En ometre tots els camps intermediate_device_*_id, es netejaran tots (comportament idempotent)."
                }
              }
            }
          }
        },
        "description": "Actualitza la configuració d'un grup de reporte existent, incloent nom, descripció, destinació de política de pedaços, patró de cerca i dispositius intermedis. Aquest endpoint implementa semàntica de reemplaçament complet: tots els camps actualitzables han d'incloure's en la sol·licitud. Ometre camps opcionals els netejarà (comportament idempotent). Pots configurar opcionalment dispositius intermedis (fins a 3) proporcionant identificadors de Workspace. Els dispositius intermedis s'utilitzen per a accions Wake-on-LAN en xarxes segures, permetent l'encesa remot de dispositius a través de passarel·les intermediàries. Els dispositius intermedis han de definir-se seqüencialment: no pots definir intermediate_device_2_id sense intermediate_device_1_id, ni intermediate_device_3_id sense intermediate_device_2_id. Tots els IDs de Workspace de dispositius intermedis han d'existir i pertànyer a l'organització. Retorna el recurs actualitzat (200) després d'una actualització exitosa."
      }
    },
    "/v2/organizations/{organization_id}/roles/{role_id}": {
      "delete": {
        "tags": [
          "Rols"
        ],
        "summary": "Eliminar un rol",
        "operationId": "delete_role",
        "description": "Elimina el rol especificat dins l'abast d'una organització. No retorna contingut quan l'eliminació es realitza correctament.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "role_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del rol.",
            "example": "64f0c2a1b2d3e4f5060708aa"
          }
        ],
        "responses": {
          "204": {
            "description": "Rol d'usuari eliminat correctament."
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_role_id": {
                    "summary": "Format d'identificador de rol no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de role_id no válido",
                        "code": "bad_request",
                        "details": "role_id debe ser una cadena hexadecimal en minúsculas de 24 caracteres"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Rol no trobat dins l'abast autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "role_not_found": {
                    "summary": "No s'ha trobat el rol sol·licitat",
                    "value": {
                      "error": {
                        "message": "Rol no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "La sol·licitud no es pot processar perquè el rol encara té usuaris assignats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "role_has_assigned_users": {
                    "summary": "El rol encara té usuaris assignats",
                    "value": {
                      "error": {
                        "message": "El rol tiene usuarios asignados",
                        "code": "unprocessable_entity",
                        "details": "Elimina las asignaciones del rol de los usuarios antes de eliminar este rol"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Rols"
        ],
        "summary": "Recuperar un rol",
        "operationId": "get_role_by_id",
        "description": "Retorna detalls del rol sol·licitat dins de l'àmbit d'una organització.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "role_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del rol.",
            "example": "64f0c2a1b2d3e4f5060708aa"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalls del rol d'usuari recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleV2"
                },
                "examples": {
                  "role_details": {
                    "summary": "Resposta de detall del rol",
                    "value": {
                      "id": "64f0c2a1b2d3e4f5060708aa",
                      "name": "Administrador de la organización",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "created_at": "2026-03-12T10:30:00Z",
                      "created_by": "64f0c2a1b2d3e4f5060708bb",
                      "permissions": [
                        {
                          "portal_permission": "organization_admin",
                          "workspaces_permission": "admin",
                          "analyzer_permission": "access",
                          "target_organization": "all",
                          "target_reporting_groups": [
                            "64f0c2a1b2d3e4f5060708c1",
                            "64f0c2a1b2d3e4f5060708c2"
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_role_id": {
                    "summary": "Format d'identificador de rol no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de role_id no válido",
                        "code": "bad_request",
                        "details": "role_id debe ser una cadena hexadecimal en minúsculas de 24 caracteres"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Rol no trobat dins l'abast autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "role_not_found": {
                    "summary": "No s'ha trobat el rol sol·licitat",
                    "value": {
                      "error": {
                        "message": "Rol no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Rols"
        ],
        "summary": "Actualitzar un rol",
        "operationId": "update_role_by_id",
        "description": "Realitza una actualització de substitució completa dels camps mutables del rol en una sola sol·licitud, inclòs el conjunt complet de permisos.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "role_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de rol.",
            "example": "64f0c2a1b2d3e4f5060708aa"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoleRequestV2"
              },
              "examples": {
                "full_update_organization_scoped": {
                  "summary": "Actualitzar rol amb permisos d'abast organitzatiu",
                  "value": {
                    "name": "Operador de organizacion",
                    "permissions": [
                      {
                        "target_organization": "507f1f77bcf86cd799439011",
                        "portal_permission": "organization_admin",
                        "workspaces_permission": "admin_read_only",
                        "analyzer_permission": "access",
                        "target_reporting_groups": [
                          "64f0c2a1b2d3e4f5060708c1",
                          "64f0c2a1b2d3e4f5060708c2"
                        ]
                      }
                    ]
                  }
                },
                "full_update_mixed_scopes": {
                  "summary": "Actualitzar rol amb permisos d'abast mixt",
                  "value": {
                    "name": "Soporte de plataforma",
                    "permissions": [
                      {
                        "target_organization": "all",
                        "portal_permission": "platform",
                        "workspaces_permission": "admin",
                        "analyzer_permission": "admin",
                        "target_reporting_groups": "all"
                      },
                      {
                        "target_organization": "507f1f77bcf86cd799439011",
                        "portal_permission": "l2_support_team",
                        "workspaces_permission": "l2_support_team",
                        "analyzer_permission": "access",
                        "target_reporting_groups": [
                          "64f0c2a1b2d3e4f5060708d1"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rol actualitzat correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleV2"
                }
              }
            }
          },
          "400": {
            "description": "Paràmetre de ruta invàlid o contracte del cos de la sol·licitud invàlid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_request_body": {
                    "summary": "Càrrega útil d'actualització malformada",
                    "value": {
                      "error": {
                        "message": "Cuerpo de solicitud invalido",
                        "code": "bad_request",
                        "details": "permissions[0].target_organization debe ser una cadena hexadecimal en minusculas de 24 caracteres o el valor all"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No s'ha trobat el rol dins de l'abast autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "role_not_found": {
                    "summary": "No s'ha trobat el rol sol·licitat",
                    "value": {
                      "error": {
                        "message": "Rol no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "La sol·licitud entra en conflicte amb l'estat existent del rol.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "role_name_conflict": {
                    "summary": "El nom del rol ja existeix",
                    "value": {
                      "error": {
                        "message": "El nombre del rol ya existe",
                        "code": "conflict",
                        "details": "name ya esta en uso dentro de esta organizacion"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/tenants/{tenant_id}": {
      "delete": {
        "tags": [
          "Llogaters"
        ],
        "summary": "Eliminar un arrendatari",
        "operationId": "deleteTenant",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic de l'organització propietària del tenant",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "tenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del tenant que s'eliminarà",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "204": {
            "description": "Tenant eliminat correctament. L'organització relacionada ha estat desactivada. No retorna contingut en el cos de la resposta."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Paràmetres de ruta no vàlids - Format d'ID de tenant no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat: es requereix autenticació o l'usuari no té permisos per eliminar el tenant. També es retorna en intentar eliminar un tenant de la pròpia organització de l'usuari."
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Tenant no trobat"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity",
            "description": "Entitat no processable: error de validació de lògica de negoci. Causes comunes: - No es pot eliminar un tenant amb sub-tenants (l'organització té més d'un tenant) - No es pot eliminar un tenant de la pròpia organització"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Elimina un tenant existent i desactiva l'organització relacionada. No es pot eliminar un tenant de la pròpia organització de l'usuari. No es pot eliminar un tenant si l'organització té més d'un tenant."
      },
      "get": {
        "tags": [
          "Llogaters"
        ],
        "summary": "Recuperar un arrendatari",
        "operationId": "getTenantById",
        "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": "tenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del tenant",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalls del tenant recuperats correctament. La resposta inclou informació completa del tenant, incloses les assignacions de producte i política.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantByIdV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta - format d'ID de tenant invàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Tenant no trobat"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Recupera informació detallada sobre un tenant específic, inclosa la seva configuració, assignació de producte, assignació de política i metadades. Retorna dades completes del tenant per a l'organització especificada."
      },
      "put": {
        "tags": [
          "Llogaters"
        ],
        "summary": "Actualitzar un arrendatari",
        "operationId": "updateTenant",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic de l'organització propietària del tenant",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "tenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del tenant a actualitzar",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "200": {
            "description": "Nom del tenant actualitzat correctament. El nom de l'organització relacionada també s'ha actualitzat. La resposta conté el recurs actualitzat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantByIdV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Cos de la sol·licitud o paràmetres de ruta no vàlids - Falta el camp obligatori (nom) - Tipus de camp no vàlids"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat: es requereix autenticació o l'usuari no té permís per actualitzar el tenant"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Tenant no trobat"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantRequestV2"
              },
              "examples": {
                "update-tenant-name": {
                  "summary": "Actualitzar el nom d'un tenant existent",
                  "value": {
                    "name": "Tenant de Produccion Actualizado"
                  }
                }
              }
            }
          }
        },
        "description": "Actualitza el nom d'un tenant existent. L'actualització del nom del tenant també actualitza el nom de l'organització relacionada."
      }
    },
    "/v2/organizations/{organization_id}/users/{user_id}": {
      "delete": {
        "tags": [
          "Usuaris"
        ],
        "summary": "Eliminar un usuari",
        "operationId": "delete_user_by_id",
        "description": "Elimina l'usuari especificat dins l'àmbit d'una organització. ",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'usuari.",
            "example": "64f0c2a1b2d3e4f506070801"
          }
        ],
        "responses": {
          "204": {
            "description": "Usuari eliminat correctament."
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_user_id": {
                    "summary": "Format d'identificador d'usuari no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de user_id no válido",
                        "code": "bad_request",
                        "details": "user_id debe ser una cadena hexadecimal en minúsculas de 24 caracteres"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Usuari no trobat dins l'àmbit autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "user_not_found": {
                    "summary": "No es va trobar l'usuari sol·licitat",
                    "value": {
                      "error": {
                        "message": "Usuario no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Usuaris"
        ],
        "summary": "Recuperar un usuari",
        "operationId": "get_user_by_id",
        "description": "Retorna els detalls de l'usuari sol·licitat dins de l'àmbit d'una organització.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'usuari.",
            "example": "64f0c2a1b2d3e4f506070801"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalls de l'usuari recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserByIdV2"
                },
                "examples": {
                  "user_details": {
                    "summary": "Resposta de detall d'usuari",
                    "value": {
                      "id": "64f0c2a1b2d3e4f506070801",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "name": "Ana",
                      "surname": "Lopez",
                      "email": "ana.lopez@example.com",
                      "language": "en-EN",
                      "created_at": "2025-12-01T10:30:00.000Z",
                      "department": "Soporte",
                      "role_id": "64f0c2a1b2d3e4f5060708aa",
                      "created_by": "64f0c2a1b2d3e4f5060708bb",
                      "email_login_enabled": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de solicitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_user_id": {
                    "summary": "Format d'identificador d'usuari no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de user_id no valido",
                        "code": "bad_request",
                        "details": "user_id debe ser una cadena hexadecimal en minusculas de 24 caracteres"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Usuari no trobat dins de l'àmbit autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "user_not_found": {
                    "summary": "L'usuari sol·licitat no es va trobar",
                    "value": {
                      "error": {
                        "message": "Usuario no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Usuaris"
        ],
        "summary": "Actualitzar un usuari",
        "operationId": "update_user",
        "description": "Actualitza completament les dades editables de l'usuari a l'organització.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'usuari a actualitzar.",
            "example": "64f0c2a1b2d3e4f506070801"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequestV2"
              },
              "examples": {
                "full_update": {
                  "summary": "Càrrega útil completa d'actualització d'usuari",
                  "value": {
                    "name": "Ana",
                    "surname": "Lopez",
                    "email": "ana.lopez@example.com",
                    "department": "Support",
                    "role_id": "64f0c2a1b2d3e4f5060708aa"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Usuari actualitzat correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserByIdV2"
                },
                "examples": {
                  "updated": {
                    "summary": "Usuari actualitzat",
                    "value": {
                      "id": "64f0c2a1b2d3e4f506070801",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "name": "Ana",
                      "surname": "Lopez",
                      "email": "ana.lopez@example.com",
                      "language": "en-EN",
                      "created_at": "2026-06-22T16:00:00.000Z",
                      "department": "Support",
                      "role_id": "64f0c2a1b2d3e4f5060708aa",
                      "created_by": "64f0c2a1b2d3e4f5060708bb",
                      "email_login_enabled": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetre de ruta invàlid o contracte del cos de la sol·licitud invàlid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_request_body": {
                    "summary": "Càrrega d'actualització malformada",
                    "value": {
                      "error": {
                        "message": "Cuerpo de solicitud inválido",
                        "code": "bad_request",
                        "details": "el parámetro de ruta user_id debe ser una cadena hexadecimal en minúsculas de 24 caracteres"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No es va trobar el recurs objectiu dins de l'àmbit autoritzat d'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "user_not_found": {
                    "summary": "No es va trobar l'usuari objectiu",
                    "value": {
                      "error": {
                        "message": "Usuario no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "La sol·licitud entra en conflicte amb un estat de recurs existent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "email_conflict": {
                    "summary": "El correu electrònic ja existeix",
                    "value": {
                      "error": {
                        "message": "El correo electrónico ya existe",
                        "code": "conflict",
                        "details": "el correo electrónico ya está registrado para otro usuario"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/workspaces/{workspace_id}": {
      "delete": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Eliminar un workspace",
        "operationId": "delete_workspace_by_id",
        "description": "Accepta la sol·licitud d'eliminació del workspace dins l'abast d'una organització autoritzada i inicia un flux asincrònic. La resposta retorna l'operació creada, que es pot consultar després en els endpoints d'operacions.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del workspace",
            "example": "64f0c2a1b2d3e4f506070801"
          }
        ],
        "responses": {
          "202": {
            "description": "Sol·licitud acceptada. Es retorna l'operació per a seguiment en endpoints d'operacions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOperationByIdResponseV2"
                },
                "examples": {
                  "operation_created": {
                    "summary": "Operació creada per a l'eliminació asincrònica",
                    "value": {
                      "id": "64f0c2a1b2d3e4f506070811",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "name": "delete_workspace",
                      "description": "Operacion de eliminacion de workspace",
                      "status": "pending",
                      "created_at": "2026-06-05T14:12:00Z",
                      "started_at": null,
                      "ended_at": null,
                      "microservice_id": null,
                      "flow_id": null,
                      "remote_support": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de solicitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_workspace_id": {
                    "summary": "Format de workspace_id no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de workspace_id no valido",
                        "code": "bad_request",
                        "details": "workspace_id debe ser una cadena hexadecimal en minusculas de 24 caracteres"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workspace no trobat dins l'abast autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "workspace_not_found": {
                    "summary": "No s'ha trobat el workspace sol·licitat",
                    "value": {
                      "error": {
                        "message": "Workspace no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Recuperar un espai de treball",
        "operationId": "getWorkspaceById",
        "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": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del Workspace",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalls del Workspace recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspacePublicV2"
                },
                "examples": {
                  "workspace-details": {
                    "summary": "Informació detallada del Workspace",
                    "value": {
                      "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",
                      "created_at": "2023-12-18T11:26:11.11Z",
                      "last_deregistration_time": "2026-01-19T12:26:25.25Z",
                      "delete_scheduled_at": "2026-07-15T00:00:00.000Z",
                      "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": "online"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta: el format de l'ID de Workspace no és vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat: es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Workspace no trobat"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Recupera informació detallada sobre un Workspace específic."
      }
    },
    "/v2/organizations/{organization_id}/workspace-groups/{workspace_group_id}/schedules/{schedule_id}": {
      "delete": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Eliminar una programació cron",
        "operationId": "deleteWorkspaceGroupSchedule",
        "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": "workspace_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de workspaces",
            "example": "507f1f77bcf86cd799439020"
          },
          {
            "name": "schedule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic de la programació per eliminar",
            "example": "507f1f77bcf86cd799439060"
          }
        ],
        "responses": {
          "204": {
            "description": "Programació eliminada correctament. No retorna contingut."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta - format d'ID de programació no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - l'usuari no té accés a l'organització, o l'organització no existeix"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "No s'ha trobat el grup d'espais de treball o la programació, o el grup d'espais de treball pertany a una organització diferent (després de que l'autorització es validi)"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Elimina una programació cron d'un grup de workspaces. Una vegada eliminada, l'operació d'energia automatitzada definida per aquesta programació ja no s'executarà. La programació ha de pertànyer al grup de workspaces i a l'organització especificats."
      },
      "get": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Recuperar una programació cron",
        "operationId": "getWorkspaceGroupScheduleById",
        "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": "workspace_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de workspaces",
            "example": "507f1f77bcf86cd799439020"
          },
          {
            "name": "schedule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic de la programació",
            "example": "507f1f77bcf86cd799439060"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalls de programació recuperats correctament. La resposta inclou expressió cron, zona horària, tipus, informació del dispositiu intermedi i metadades d'auditoria.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceGroupScheduleV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta - format d'ID de programació no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - l'usuari no té accés a l'organització, o l'organització no existeix"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "No s'ha trobat el grup d'espais de treball o la programació, o el grup d'espais de treball pertany a una organització diferent (després de que l'autorització es validi)"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Recupera informació detallada sobre programació cron específica per a un grup de workspaces. Retorna la configuració de la programació, inclosa l'expressió cron, la zona horària, el tipus d'operació, la configuració del dispositiu intermedi i els metadades d'auditoria (creat per, actualitzat per, actualitzat en)."
      },
      "put": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Actualitzar una programació cron",
        "operationId": "updateWorkspaceGroupSchedule",
        "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": "workspace_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de workspaces",
            "example": "507f1f77bcf86cd799439020"
          },
          {
            "name": "schedule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic de la programació a actualitzar",
            "example": "507f1f77bcf86cd799439060"
          }
        ],
        "responses": {
          "200": {
            "description": "Programació actualitzada correctament. La resposta conté el recurs actualitzat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceGroupScheduleV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Falten camps obligatoris (cron_expression, time_zone, type) - Format d'expressió cron no vàlid - Valor de zona horària no vàlid - Tipus de programació no vàlid (ha de ser START, STOP o RESTART) - Format d'ID d'espai de treball intermediate_device no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup d'espais de treball o programació no trobada, o no pertany a l'organització"
          },
          "409": {
            "$ref": "#/components/responses/Conflict",
            "description": "Conflicte - Ja existeix una programació amb el mateix tipus, hora i dia (després de la conversió de zona horària), excloent la programació actual que s'està actualitzant"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity",
            "description": "Entitat no processable. Causes comunes: - L'ID d'espai de treball intermediate_device no existeix o no pertany a l'organització"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkspaceGroupScheduleRequestV2"
              },
              "examples": {
                "update-schedule-time": {
                  "summary": "Actualitzar programació per executar a una hora diferent",
                  "value": {
                    "cron_expression": "0 9 * * 1-5",
                    "time_zone": "Eastern Standard Time",
                    "type": "start"
                  }
                },
                "add-intermediate-device": {
                  "summary": "Afegir dispositiu intermedi a una programació START existent",
                  "value": {
                    "cron_expression": "0 8 * * 1-5",
                    "time_zone": "Eastern Standard Time",
                    "type": "start",
                    "intermediate_device": "507f1f77bcf86cd799439050"
                  }
                },
                "remove-intermediate-device": {
                  "summary": "Eliminar dispositiu intermedi de la programació START",
                  "value": {
                    "cron_expression": "0 8 * * 1-5",
                    "time_zone": "Eastern Standard Time",
                    "type": "start"
                  }
                },
                "change-schedule-type": {
                  "summary": "Canviar el tipus de programació de START a STOP",
                  "value": {
                    "cron_expression": "0 18 * * 1-5",
                    "time_zone": "UTC",
                    "type": "stop"
                  }
                }
              }
            }
          }
        },
        "description": "Actualitza una programació cron existent per a un grup de workspaces. S'han de proporcionar tots els camps de la programació, ja que aquest endpoint implementa semàntica de reemplaç complet. El sistema valida que no existeixi una programació en conflicte (mateix tipus, hora i dia després de la conversió de zona horària), excloent la programació actual que s'està actualitzant. Per eliminar un dispositiu intermedi d'una programació START, omet el camp intermediate_device."
      }
    },
    "/v2/organizations/{organization_id}/workspace-groups/{workspace_group_id}": {
      "delete": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Elimina un grup de workspaces",
        "operationId": "deleteWorkspaceGroup",
        "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": "workspace_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de workspaces que s'eliminarà",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "204": {
            "description": "Grup de workspaces eliminat correctament. No retorna contingut."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta - format d'ID de grup de workspaces no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup de workspaces no trobat o no pertany a l'organització"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Elimina permanentment un grup de workspaces de l'organització. Aquesta acció no es pot desfer. No retorna contingut (204) després d'una eliminació exitosa."
      },
      "get": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Recuperar un grup d'espais de treball",
        "operationId": "getWorkspaceGroupById",
        "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": "workspace_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de workspaces",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalls del grup de workspaces recuperats correctament. La resposta inclou la configuració, el tipus i la ubicació del grup de workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceGroupDetailResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta - format d'ID de grup de workspaces no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup de workspaces no trobat o no pertany a l'organització"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Recupera informació detallada sobre un grup de workspaces específic, inclosa la seva configuració, tipus i ubicació. Retorna dades del grup de workspaces que coincideixen amb l'estructura del endpoint de llistat."
      },
      "put": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Actualitzar un grup d'espais de treball",
        "operationId": "updateWorkspaceGroup",
        "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": "workspace_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de workspaces que s'actualitzarà",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "200": {
            "description": "Grup de workspaces actualitzat correctament. La resposta conté el recurs actualitzat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceGroupDetailResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Falten camps requerits (nom, descripció, localització) - Valors de camp no vàlids - Estructura de localització no vàlida - Falten camps requerits de localització (latitud, longitud, adreça)"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat - es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup de workspaces no trobat o no pertany a l'organització"
          },
          "409": {
            "$ref": "#/components/responses/Conflict",
            "description": "Conflicte - ja existeix un grup de workspaces amb el mateix nom"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity",
            "description": "Entitat no processable - violació de regla de negoci (p. ex., no es pot establir filter en un grup de workspaces de Entra ID)"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceGroupUpdateRequestV2"
              },
              "examples": {
                "update-workspace-group-(full-replacement)": {
                  "summary": "Actualitzar grup de workspaces amb tots els camps requerits",
                  "value": {
                    "name": "Grupo de Workspace de Produccion Actualizado",
                    "description": "Grupo de workspaces actualizado para entornos de producción",
                    "location": {
                      "latitude": 40.4168,
                      "longitude": -3.7038,
                      "address": "Madrid, Espana",
                      "description": "Ubicación de oficina actualizada"
                    }
                  }
                },
                "update-workspace-group-without-location-description": {
                  "summary": "Actualitzar grup de workspaces amb camps requerits; la descripció de ubicació és opcional",
                  "value": {
                    "name": "Grupo de Workspace de Produccion Actualizado",
                    "description": "Grupo de workspaces actualizado para entornos de producción",
                    "location": {
                      "latitude": 40.4168,
                      "longitude": -3.7038,
                      "address": "Madrid, Espana"
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Actualitza la configuració d'un grup de workspaces existent, incloent name, description i location. Aquesta és una sol·licitud PUT que implementa reemplaçament complet: tots els camps actualitzables són obligatoris. Torna el recurs actualitzat (200) després d'una actualització reeixida."
      }
    },
    "/v2/organizations/{organization_id}/audits": {
      "get": {
        "tags": [
          "Auditoria"
        ],
        "operationId": "get_audits",
        "summary": "Llistar auditories",
        "description": "Retorna els esdeveniments d'auditoria de l'organització indicada per consultar quina acció es va realitzar, sobre quina entitat, quan va ocórrer i qui la va desencadenar. Quan `trigger_type` és `user`, `trigger_id` correspon a l'identificador de l'usuari i es pot consultar mitjançant l'endpoint d'usuaris. Quan `trigger_type` és `api`, `trigger_id` correspon a l'identificador de l'API key; actualment les API keys no són consultables des d'aquesta API pública.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "description": "Identificador de l'organització.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Número de pàgina a consultar.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Quantitat d'elements per pàgina.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "description": "Llista separada per comes amb els camps de resposta a incloure.",
            "schema": {
              "type": "string",
              "example": "id,audited_at,action,entity_type,entity_id,trigger_type,trigger_id,trigger_name"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "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>`).",
            "schema": {
              "type": "string",
              "pattern": "^([a-z_]+):(asc|desc)$"
            }
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "description": "Expressió JSON de filtrat sobre camps filtrables de la resposta.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "simple": {
                "summary": "Filtre simple per tipus d'entitat",
                "value": "{\"field\":\"entity_type\",\"op\":\"eq\",\"value\":\"workspace\"}"
              },
              "complex-and": {
                "summary": "Combinació AND per acció i tipus d'entitat",
                "value": "{\"and\":[{\"field\":\"action\",\"op\":\"eq\",\"value\":\"update\"},{\"field\":\"entity_type\",\"op\":\"eq\",\"value\":\"workspace\"}]}"
              },
              "complex-or-and": {
                "summary": "Combinació OR dins de AND amb actor i acció",
                "value": "{\"and\":[{\"or\":[{\"field\":\"trigger_id\",\"op\":\"eq\",\"value\":\"8c1a7e2b9f4d3c6e0a5b1d2f\"},{\"field\":\"trigger_id\",\"op\":\"eq\",\"value\":\"f0b9c3d7a1e5f8b2c4d6e9a0\"}]},{\"field\":\"action\",\"op\":\"eq\",\"value\":\"delete\"}]}"
              }
            }
          },
          {
            "name": "aggregate",
            "in": "query",
            "required": false,
            "description": "Expressió JSON per a agregació. Estructura: {\"group_by\":[\"field\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}. No es pot combinar amb `fields`.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "examples": {
              "group-by-action-count": {
                "summary": "Agrupar per acció i comptar",
                "value": "{\"group_by\":[\"action\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}"
              },
              "group-by-entity-type-count": {
                "summary": "Agrupar per tipus d'entitat i comptar",
                "value": "{\"group_by\":[\"entity_type\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Llistat d'auditories obtingut correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAuditsResponseV2"
                },
                "examples": {
                  "list-mode": {
                    "summary": "Resposta en mode llistat",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "b7e4c2a9d1f6038e5a2c9b4d",
                          "audited_at": "2026-06-30T11:45:12.000Z",
                          "organization_id": "a9d3f1b7c4e8026d5f0a3c8e",
                          "action": "update",
                          "entity_type": "workspace",
                          "entity_id": "c2f8a1d4b9e3067f5c0d2a8e",
                          "trigger_type": "api",
                          "trigger_id": "8c1a7e2b9f4d3c6e0a5b1d2f",
                          "trigger_name": "Api Key"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": "BAD_REQUEST",
                    "message": "Invalid request data",
                    "details": "fields and aggregate cannot be combined."
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat per accedir a l'organització sol·licitada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "No autorizado para acceder a la organización solicitada."
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "El recurso solicitado no existe en la organización indicada."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": "internal_error",
                    "message": "Se ha producido un error interno."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/flows/condition-types": {
      "get": {
        "tags": [
          "Fluxos"
        ],
        "summary": "Llistar tipus de condició",
        "operationId": "listConditionTypes",
        "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,
              "minimum": 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"
            },
            "description": "Camp d'ordenació amb sufix d'ordre opcional (:asc o :desc). Usa noms de propietats de la resposta. Camps vàlids: id, name, description, type, value_type, value_placeholder, period. Exemple: \"name:asc\" o \"type:desc\""
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Llista de camps separada per comes per incloure en cada element de tipus de condició. Camps seleccionables: id, name, description, type, frequency_values, value_type, value_placeholder, op_values, period. El camp id sempre s'inclou.",
            "example": "name,type,op_values"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Filtra tipus de condició per un o més criteris. Proporciona un objecte JSON amb condicions de filtre. Pots filtrar per qualsevol camp retornat 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": "Filtrar per tipus de condició",
                "description": "Retorna tipus de condició que coincideixen amb un identificador de tipus específic.",
                "value": "{\"field\": \"type\", \"op\": \"eq\", \"value\": \"osVersion\"}"
              },
              "complex-and": {
                "summary": "Filtrar per tipus de valor i suport periòdic",
                "description": "Retorna tipus de condició basats en cadenes que no són periòdics.",
                "value": "{\"and\": [{\"field\": \"value_type\", \"op\": \"eq\", \"value\": \"string\"}, {\"field\": \"period\", \"op\": \"eq\", \"value\": false}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "description": "Coincide por texto de nombre o descripció y restringe por tipus de condición.",
                "value": "{\"and\": [{\"or\": [{\"field\": \"name\", \"op\": \"contains\", \"value\": \"os\"}, {\"field\": \"description\", \"op\": \"contains\", \"value\": \"version\"}]}, {\"field\": \"type\", \"op\": \"eq\", \"value\": \"osVersion\"}]}"
              }
            }
          },
          {
            "name": "Accept-Language",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "en-EN",
                "es-ES",
                "pt-BR",
                "ca-ES",
                "eu-ES"
              ],
              "default": "es-ES"
            },
            "description": "Codi d'idioma per a camps de text que admeten múltiples idiomes. En crear o actualitzar recursos, especifica l'idioma dels valors de text proporcionats. En recuperar recursos, determina quina variant d'idioma dels camps de text multilingües es torna. Valors acceptats: 'en-EN' (anglès), 'es-ES' (espanyol), 'pt-BR' (portuguès), 'ca-ES' (català), 'eu-ES' (euskera). Si no es proporciona, el valor predeterminat és 'es-ES'."
          }
        ],
        "responses": {
          "200": {
            "description": "Llista paginada de tipus de condició recuperada correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConditionTypeV2ListResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta - ID d'organització invàlid"
          },
          "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"
          }
        },
        "description": "Recupera una llista paginada de tipus de condició disponibles que poden usar-se en condicions de flux. Admet paginació, ordenació, filtrat i selecció de camps."
      }
    },
    "/v2/organizations/{organization_id}/digital-activity/core-process-groups/{core_process_group_id}/core-processes": {
      "get": {
        "tags": [
          "Activitat digital"
        ],
        "summary": "Llistar processos core del grup",
        "operationId": "listDigitalActivityCoreProcessGroupCoreProcesses",
        "description": "Retorna la llista completa actual de processos core del grup dins de l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "core_process_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del grup de processos core.",
            "example": "64f0c2a1b2d3e4f506070811"
          }
        ],
        "responses": {
          "200": {
            "description": "Processos core recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDigitalActivityCoreProcessGroupCoreProcessesResponseV2"
                },
                "examples": {
                  "core_processes_list": {
                    "summary": "Llista completa de processos core del grup",
                    "value": {
                      "data": [
                        {
                          "name": "Microsoft Word",
                          "process_name": "WINWORD.EXE"
                        },
                        {
                          "name": "Microsoft Excel",
                          "process_name": "EXCEL.EXE"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_path_params": {
                    "summary": "Format d'identificadors invàlid",
                    "value": {
                      "error": {
                        "message": "Parámetros de ruta no válidos",
                        "code": "bad_request",
                        "details": "organization_id y core_process_group_id deben tener 24 caracteres hexadecimales."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "L'activitat digital no està habilitada per a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "digital_activity_not_enabled": {
                    "summary": "Activitat digital no habilitada",
                    "value": {
                      "error": {
                        "message": "Digital Activity is not enabled for organization",
                        "code": "forbidden"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Grup de processos core no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límit de sol·licituds excedit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Masses sol·licituds",
                    "value": {
                      "error": {
                        "message": "Demasiadas solicitudes",
                        "code": "too_many_requests"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Activitat digital"
        ],
        "summary": "Reemplaçar processos core del grup",
        "operationId": "replaceDigitalActivityCoreProcessGroupCoreProcesses",
        "description": "Reemplaça el conjunt complet de processos core d'un grup dins de l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "core_process_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del grup de processos core.",
            "example": "64f0c2a1b2d3e4f506070811"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceDigitalActivityCoreProcessGroupCoreProcessesRequestV2"
              },
              "examples": {
                "full_replace_two_items": {
                  "summary": "Reemplaçament complet amb dos processos",
                  "value": {
                    "core_processes": [
                      {
                        "name": "Excel",
                        "process_name": "excel.exe"
                      },
                      {
                        "name": "Adobe Acrobat",
                        "process_name": "acrobat.exe"
                      }
                    ]
                  }
                },
                "full_replace_empty_list": {
                  "summary": "Reemplaçament complet per buidar la llista",
                  "value": {
                    "core_processes": []
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Processos core reemplaçats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCoreProcessGroupCoreProcessesResponseV2"
                },
                "examples": {
                  "full_replace_response": {
                    "summary": "Estat final de processos core després del reemplaçament",
                    "value": {
                      "data": [
                        {
                          "name": "Microsoft Word",
                          "process_name": "WINWORD.EXE"
                        },
                        {
                          "name": "Microsoft Excel",
                          "process_name": "EXCEL.EXE"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres o cos de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_request": {
                    "summary": "Sol·licitud invàlida",
                    "value": {
                      "error": {
                        "message": "Parámetros o cuerpo de solicitud no válidos",
                        "code": "bad_request",
                        "details": "organization_id y core_process_group_id deben tener 24 caracteres hexadecimales y cada elemento de core_processes debe incluir name y process_name."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "L'activitat digital no està habilitada per a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "digital_activity_not_enabled": {
                    "summary": "Activitat digital no habilitada",
                    "value": {
                      "error": {
                        "message": "Digital Activity is not enabled for organization",
                        "code": "forbidden"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Grup de processos core no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicte de negoci per a reemplaçament del recurs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "duplicate_process_name": {
                    "summary": "Procés duplicat en la col·lecció",
                    "value": {
                      "error": {
                        "message": "La colección incluye procesos duplicados",
                        "code": "core_process_already_exists",
                        "details": "Cada process_name debe ser único dentro de core_processes."
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límit de sol·licituds excedit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Masses sol·licituds",
                    "value": {
                      "error": {
                        "message": "Demasiadas solicitudes",
                        "code": "too_many_requests"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/digital-activity/core-process-groups/{core_process_group_id}": {
      "get": {
        "tags": [
          "Activitat digital"
        ],
        "summary": "Recuperar grup de processos core",
        "operationId": "getDigitalActivityCoreProcessGroup",
        "description": "Retorna el detall d'un grup de processos core de l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "core_process_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del grup de processos core.",
            "example": "64f0c2a1b2d3e4f506070811"
          }
        ],
        "responses": {
          "200": {
            "description": "Grup de processos core recuperat correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDigitalActivityCoreProcessGroupResponseV2"
                },
                "examples": {
                  "core_process_group_detail": {
                    "summary": "Detall del grup de processos core",
                    "value": {
                      "id": "64f0c2a1b2d3e4f506070811",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "name": "Grupo de procesos core A",
                      "description": "Grupo principal de procesos de productividad",
                      "workspace_group_id": "64f0c2a1b2d3e4f506070822"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_path_params": {
                    "summary": "Format d'identificadors invàlid",
                    "value": {
                      "error": {
                        "message": "Parámetros de ruta no válidos",
                        "code": "bad_request",
                        "details": "organization_id y core_process_group_id deben tener 24 caracteres hexadecimales."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "L'activitat digital no està habilitada per a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "digital_activity_not_enabled": {
                    "summary": "Activitat digital no habilitada",
                    "value": {
                      "error": {
                        "message": "Digital Activity is not enabled for organization",
                        "code": "forbidden"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límit de sol·licituds excedit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Masses sol·licituds",
                    "value": {
                      "error": {
                        "message": "Demasiadas solicitudes",
                        "code": "too_many_requests"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Activitat digital"
        ],
        "summary": "Actualitzar grup de processos core",
        "operationId": "updateDigitalActivityCoreProcessGroup",
        "description": "Actualitza completament un grup de processos core en l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "core_process_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del grup de processos core.",
            "example": "64f0c2a1b2d3e4f506070811"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDigitalActivityCoreProcessGroupRequestV2"
              },
              "examples": {
                "full_update_with_description": {
                  "summary": "Actualització completa amb descripció",
                  "value": {
                    "name": "Grupo base de productividad",
                    "description": "Grupo principal para procesos de productividad",
                    "workspace_group_id": "64f0c2a1b2d3e4f506070822"
                  }
                },
                "full_update_without_description": {
                  "summary": "Actualització completa sense descripció",
                  "value": {
                    "name": "Grupo base de productividad",
                    "description": null,
                    "workspace_group_id": "64f0c2a1b2d3e4f506070823"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Grup de processos core actualitzat correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDigitalActivityCoreProcessGroupResponseV2"
                },
                "examples": {
                  "updated": {
                    "summary": "Recurs actualitzat",
                    "value": {
                      "id": "64f0c2a1b2d3e4f506070811",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "name": "Grupo base de productividad",
                      "description": "Grupo principal para procesos de productividad",
                      "workspace_group_id": "64f0c2a1b2d3e4f506070822"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Sol·licitud invàlida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_body": {
                    "summary": "Cos de sol·licitud invàlid",
                    "value": {
                      "error": {
                        "message": "Cuerpo de solicitud inválido",
                        "code": "bad_request",
                        "details": "name, description y workspace_group_id son obligatorios y deben cumplir el formato esperado."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "L'activitat digital no està habilitada per a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "digital_activity_not_enabled": {
                    "summary": "Activitat digital no habilitada",
                    "value": {
                      "error": {
                        "message": "Digital Activity is not enabled for organization",
                        "code": "forbidden"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicte de negoci per a l'actualització del recurs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "duplicate_name": {
                    "summary": "Nom ja registrat",
                    "value": {
                      "error": {
                        "message": "Ya existe un grupo de procesos core con ese nombre",
                        "code": "core_process_group_name_already_exists"
                      }
                    }
                  },
                  "workspace_group_already_assigned": {
                    "summary": "Grup de workspaces ja assignat",
                    "value": {
                      "error": {
                        "message": "El grupo de workspaces ya está asignado a otro grupo de procesos core",
                        "code": "core_process_group_workspace_group_already_assigned"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límit de sol·licituds excedit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Masses sol·licituds",
                    "value": {
                      "error": {
                        "message": "Demasiadas solicitudes",
                        "code": "too_many_requests"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/digital-activity/core-process-metrics": {
      "get": {
        "tags": [
          "Activitat digital"
        ],
        "summary": "Llistar mètriques de processos core",
        "operationId": "listDigitalActivityCoreProcessMetrics",
        "description": "Retorna una llista paginada de mètriques d'activitat digital per processos core de l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Camps de resposta separats per comes per a cada element.",
            "example": "workspace_id,core_process_group_id,reporting_time_hours,month,year"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió JSON de filtres sobre camps filtrables del recurs.",
            "examples": {
              "simple": {
                "summary": "Filtrar per identificador de workspace",
                "value": "{\"field\":\"workspace_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070811\"}"
              },
              "complex-and": {
                "summary": "Filtra per any i llindar d'activitat",
                "value": "{\"and\":[{\"field\":\"year\",\"op\":\"eq\",\"value\":2025},{\"field\":\"core_activity_time_hours\",\"op\":\"lte\",\"value\":120}]}"
              },
              "complex-or-and": {
                "summary": "Combina grups de processos amb mes objectiu",
                "value": "{\"and\":[{\"or\":[{\"field\":\"core_process_group_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070822\"},{\"field\":\"reporting_group_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070823\"}]},{\"field\":\"month\",\"op\":\"eq\",\"value\":3}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^([a-z_]+):(asc|desc)$"
            },
            "description": "Expressió d'ordenació amb el format <field>:asc|desc sobre camps escalars ordenables de la resposta.",
            "example": "reporting_time_hours:desc"
          }
        ],
        "responses": {
          "200": {
            "description": "Mètriques d'activitat digital per processos core recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDigitalActivityCoreProcessMetricsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb resultats",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "workspace_id": "64f0c2a1b2d3e4f506070811",
                          "core_process_group_id": "64f0c2a1b2d3e4f506070822",
                          "reporting_group_id": "64f0c2a1b2d3e4f506070823",
                          "organization_id": "507f1f77bcf86cd799439011",
                          "core_activity_time_hours": 42.5,
                          "reporting_time_hours": 120.5,
                          "opened_session_time_hours": 150.75,
                          "user_active_time_hours": 98.2,
                          "month": 3,
                          "year": 2025,
                          "deleted_date": null
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no válido",
                        "code": "bad_request",
                        "details": "El parámetro filters debe ser una cadena JSON válida."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "L'activitat digital no està habilitada per a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "digital_activity_not_enabled": {
                    "summary": "Activitat digital no habilitada",
                    "value": {
                      "error": {
                        "message": "Digital Activity is not enabled for organization",
                        "code": "forbidden"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límit de sol·licituds excedit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Masses sol·licituds",
                    "value": {
                      "error": {
                        "message": "Demasiadas solicitudes",
                        "code": "too_many_requests"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/digital-activity/hybrid-work-metrics": {
      "get": {
        "tags": [
          "Activitat digital"
        ],
        "summary": "Llistar mètriques de treball híbrid",
        "operationId": "listDigitalActivityHybridWorkMetrics",
        "description": "Retorna una llista paginada de mètriques híbrides d'activitat digital de l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "include_deleted_workspaces",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Controla la inclusió de workspaces eliminats. Si és false s'exclouen; si s'ometeixen o és true s'inclouen."
          },
          {
            "name": "include_virtual_workspaces",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Controla la inclusió de workspaces virtuals. Si és false s'exclouen; si s'ometeixen o és true s'inclouen."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Camps de resposta separats per comes per a cada element.",
            "example": "user_name,total_active_time_hours,month,year,organization_id"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió JSON de filtres sobre camps filtrables del recurs.",
            "examples": {
              "simple": {
                "summary": "Filtrar per usuari",
                "value": "{\"field\":\"user_name\",\"op\":\"contains\",\"value\":\"ana\"}"
              },
              "complex-and": {
                "summary": "Filtrar per any i activitat total mínima",
                "value": "{\"and\":[{\"field\":\"year\",\"op\":\"eq\",\"value\":2025},{\"field\":\"total_active_time_hours\",\"op\":\"gte\",\"value\":40}]}"
              },
              "complex-or-and": {
                "summary": "Combina organització i activitat remota",
                "value": "{\"and\":[{\"field\":\"organization_id\",\"op\":\"eq\",\"value\":\"507f1f77bcf86cd799439011\"},{\"field\":\"remote_active_time_hours\",\"op\":\"gte\",\"value\":10}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^([a-z_]+):(asc|desc)$"
            },
            "description": "Expressió d'ordenació amb el format <field>:asc|desc sobre camps escalars ordenables de la resposta.",
            "example": "total_active_time_hours:desc"
          }
        ],
        "responses": {
          "200": {
            "description": "Mètriques híbrides d'activitat digital recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDigitalActivityHybridWorkMetricsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb resultats",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "user_name": "ana.lopez",
                          "office_active_time_hours": 18.25,
                          "remote_active_time_hours": 22.5,
                          "ambiguous_active_time_hours": 1,
                          "total_active_time_hours": 41.75,
                          "month": 3,
                          "year": 2025,
                          "organization_id": "507f1f77bcf86cd799439011"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no válido",
                        "code": "bad_request",
                        "details": "El parámetro filters debe ser una cadena JSON válida."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "L'activitat digital no està habilitada per a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "digital_activity_not_enabled": {
                    "summary": "Activitat digital no habilitada",
                    "value": {
                      "error": {
                        "message": "Digital Activity is not enabled for organization",
                        "code": "forbidden"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límit de sol·licituds excedit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Masses sol·licituds",
                    "value": {
                      "error": {
                        "message": "Demasiadas solicitudes",
                        "code": "too_many_requests"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/digital-activity/user-metrics": {
      "get": {
        "tags": [
          "Activitat digital"
        ],
        "summary": "Llistar mètriques d'usuari",
        "operationId": "listDigitalActivityUserMetrics",
        "description": "Retorna una llista paginada de mètriques d'activitat digital per usuari de l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Camps de resposta separats per comes per a cada element.",
            "example": "workspace_id,user_name,user_active_time_hours,month,year"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió JSON de filtres sobre camps filtrables del recurs.",
            "examples": {
              "simple": {
                "summary": "Filtrar per usuari",
                "value": "{\"field\":\"user_name\",\"op\":\"contains\",\"value\":\"ana\"}"
              },
              "complex-and": {
                "summary": "Filtra per any i activitat màxima",
                "value": "{\"and\":[{\"field\":\"year\",\"op\":\"eq\",\"value\":2025},{\"field\":\"user_active_time_hours\",\"op\":\"lte\",\"value\":120}]}"
              },
              "complex-or-and": {
                "summary": "Combina organització i grup de reporting",
                "value": "{\"and\":[{\"or\":[{\"field\":\"organization_id\",\"op\":\"eq\",\"value\":\"507f1f77bcf86cd799439011\"},{\"field\":\"organization_id\",\"op\":\"eq\",\"value\":\"507f1f77bcf86cd799439012\"}]},{\"field\":\"reporting_group_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070822\"}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^([a-z_]+):(asc|desc)$"
            },
            "description": "Expressió d'ordenació amb el format <field>:asc|desc sobre camps escalars ordenables de la resposta.",
            "example": "user_active_time_hours:desc"
          }
        ],
        "responses": {
          "200": {
            "description": "Mètriques d'activitat digital per usuari recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDigitalActivityUserMetricsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb resultats",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "workspace_id": "64f0c2a1b2d3e4f506070811",
                          "user_name": "ana.lopez",
                          "reporting_group_id": "64f0c2a1b2d3e4f506070822",
                          "reporting_time_hours": 120.5,
                          "opened_session_time_hours": 150.75,
                          "user_active_time_hours": 98.2,
                          "month": 3,
                          "year": 2025,
                          "deleted_date": null,
                          "organization_id": "507f1f77bcf86cd799439011"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no válido",
                        "code": "bad_request",
                        "details": "El parámetro filters debe ser una cadena JSON válida."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "L'activitat digital no està habilitada per a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "digital_activity_not_enabled": {
                    "summary": "Activitat digital no habilitada",
                    "value": {
                      "error": {
                        "message": "Digital Activity is not enabled for organization",
                        "code": "forbidden"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límit de sol·licituds excedit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Masses sol·licituds",
                    "value": {
                      "error": {
                        "message": "Demasiadas solicitudes",
                        "code": "too_many_requests"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/digital-activity/workspace-metrics": {
      "get": {
        "tags": [
          "Activitat digital"
        ],
        "summary": "Llistar mètriques de workspace",
        "operationId": "listDigitalActivityWorkspaceMetrics",
        "description": "Retorna una llista paginada de mètriques d'activitat digital per workspace de l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Camps de resposta separats per comes per a cada element.",
            "example": "workspace_id,reporting_time_hours,month,year"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió JSON de filtres sobre camps filtrables del recurs.",
            "examples": {
              "simple": {
                "summary": "Filtrar per identificador de workspace",
                "value": "{\"field\":\"workspace_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070811\"}"
              },
              "complex-and": {
                "summary": "Filtra per any i llindar de sessió oberta",
                "value": "{\"and\":[{\"field\":\"year\",\"op\":\"eq\",\"value\":2025},{\"field\":\"opened_session_time_hours\",\"op\":\"lte\",\"value\":150.75}]}"
              },
              "complex-or-and": {
                "summary": "Combina grup de reporting amb activitat d'usuari",
                "value": "{\"and\":[{\"or\":[{\"field\":\"reporting_group_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070822\"},{\"field\":\"reporting_group_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f506070823\"}]},{\"field\":\"user_active_time_hours\",\"op\":\"gte\",\"value\":80}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^([a-z_]+):(asc|desc)$"
            },
            "description": "Expressió d'ordenació amb el format <field>:asc|desc sobre camps escalars ordenables de la resposta.",
            "example": "reporting_time_hours:desc"
          }
        ],
        "responses": {
          "200": {
            "description": "Mètriques d'activitat digital per workspace recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDigitalActivityWorkspaceMetricsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb resultats",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "workspace_id": "64f0c2a1b2d3e4f506070811",
                          "reporting_group_id": "64f0c2a1b2d3e4f506070822",
                          "reporting_time_hours": 120.5,
                          "opened_session_time_hours": 150.75,
                          "user_active_time_hours": 98.2,
                          "core_activity_time_hours": 45,
                          "month": 3,
                          "year": 2025,
                          "deleted_date": null
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no válido",
                        "code": "bad_request",
                        "details": "El parámetro filters debe ser una cadena JSON válida."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "L'activitat digital no està habilitada per a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "digital_activity_not_enabled": {
                    "summary": "Activitat digital no habilitada",
                    "value": {
                      "error": {
                        "message": "Digital Activity is not enabled for organization",
                        "code": "forbidden"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs no trobat dins de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Recurs inexistent",
                    "value": {
                      "error": {
                        "message": "Recurso no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Límit de sol·licituds excedit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Masses sol·licituds",
                    "value": {
                      "error": {
                        "message": "Demasiadas solicitudes",
                        "code": "too_many_requests"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/installed-apps/{installed_app_id}": {
      "get": {
        "tags": [
          "Aplicacions instal·lades"
        ],
        "summary": "Recuperar una aplicació instal·lada",
        "operationId": "get_installed_app_by_id",
        "description": "Retorna els detalls de l'aplicació instal·lada sol·licitada dins de l'abast d'una organització.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "installed_app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'aplicació instal·lada.",
            "example": "64f0c2a1b2d3e4f5060709aa"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalls de l'aplicació instal·lada recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetInstalledAppByIdResponseV2"
                },
                "examples": {
                  "installed_app_details": {
                    "summary": "Resposta de detall de l'aplicació instal·lada",
                    "value": {
                      "id": "64f0c2a1b2d3e4f5060709aa",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "name": "Google Chrome",
                      "publisher": "Google LLC",
                      "operating_system": "windows",
                      "notes": "Administrada mediante catálogo de software",
                      "discovered_at": "2026-02-15T09:30:00.000Z",
                      "reported_at": "2026-04-01T07:45:00.000Z",
                      "installations": 4
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_installed_app_id": {
                    "summary": "Format de l'identificador d'aplicació instal·lada no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de installed_app_id no válido",
                        "code": "bad_request",
                        "details": "installed_app_id debe ser una cadena hexadecimal en minúsculas de 24 caracteres"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o organització no accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Aplicació instal·lada no trobada dins de l'abast de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "installed_app_not_found": {
                    "summary": "No s'ha trobat l'aplicació instal·lada sol·licitada",
                    "value": {
                      "error": {
                        "message": "Aplicación instalada no encontrada",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/installed-apps/{installed_app_id}/versions": {
      "get": {
        "tags": [
          "Aplicacions instal·lades"
        ],
        "summary": "Llistar versions observades per a una aplicació instal·lada",
        "description": "Retorna una llista paginada de versions observades per l'aplicació instal·lada dins de l'abast de la organització.",
        "operationId": "get_installed_app_versions",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "installed_app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'aplicació instal·lada.",
            "example": "64f0c2a1b2d3e4f5060708c1"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps dels elements de resposta, separats per comes, que s'han d'incloure."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre rutes de camps filtrables de la resposta.",
            "examples": {
              "simple": {
                "summary": "Filtrar per versió exacta",
                "value": "{\"field\":\"version\",\"op\":\"eq\",\"value\":\"117.0.5938.149\"}"
              },
              "complex-and": {
                "summary": "Filtrar per una versió exacta dins d'una expressió and",
                "value": "{\"and\":[{\"field\":\"version\",\"op\":\"eq\",\"value\":\"117.0.5938.149\"},{\"field\":\"version\",\"op\":\"eq\",\"value\":\"117.0.5938.149\"}]}"
              },
              "complex-or-and": {
                "summary": "Combinar alternatives de versió en lògica niada",
                "value": "{\"and\":[{\"or\":[{\"field\":\"version\",\"op\":\"eq\",\"value\":\"117.0.5938.149\"},{\"field\":\"version\",\"op\":\"eq\",\"value\":\"118.0.5993.70\"}]},{\"field\":\"version\",\"op\":\"eq\",\"value\":\"118.0.5993.70\"}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(version|discovered_at|reported_at):(asc|desc)$"
            },
            "description": "Expressió de ordenació en el format <field>:asc|desc"
          }
        ],
        "responses": {
          "200": {
            "description": "Versions d'aplicacions instal·lades recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetInstalledAppVersionsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb files de versions",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "version": "118.0.5993.90",
                          "reported_at": "2026-04-05T10:12:00Z",
                          "discovered_at": "2026-02-01T08:30:00Z"
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No s'han trobat versions",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de solicitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no valido",
                        "code": "bad_request",
                        "details": "filters debe ser un JSON valido"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Error d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "El recurs sol·licitat no s'ha trobat dins de l'abast de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "installed_app_not_found": {
                    "summary": "No s'ha trobat l'aplicació instal·lada",
                    "value": {
                      "error": {
                        "message": "No encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/installed-apps/{installed_app_id}/workspaces": {
      "get": {
        "tags": [
          "Aplicacions instal·lades"
        ],
        "summary": "Llistar workspaces per a una app instal·lada",
        "description": "Retorna una llista paginada d'observacions a nivell de Workspace per l'app instal·lada seleccionada en l'abast de l'organització.",
        "operationId": "get_installed_app_workspaces",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "installed_app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador d'app instal·lada.",
            "example": "64f0c2a1b2d3e4f5060709aa"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps d'elements de resposta separats per comes per incloure."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre rutes de camps de resposta filtrables.",
            "examples": {
              "simple": {
                "summary": "Filtrar per workspace_id",
                "value": "{\"field\":\"workspace_id\",\"op\":\"eq\",\"value\":\"64f0c2a1b2d3e4f5060708f1\"}"
              },
              "complex-and": {
                "summary": "Filtrar per install_location i versió",
                "value": "{\"and\":[{\"field\":\"install_location\",\"op\":\"contains\",\"value\":\"Program Files\"},{\"field\":\"version\",\"op\":\"contains\",\"value\":\"124\"}]}"
              },
              "complex-or-and": {
                "summary": "Combinar alternatives de installed_at amb una condició d'organització",
                "value": "{\"and\":[{\"or\":[{\"field\":\"installed_at\",\"op\":\"eq\",\"value\":\"2025-12-01T08:00:00.000Z\"},{\"field\":\"installed_at\",\"op\":\"eq\",\"value\":\"2025-11-15T09:30:00.000Z\"}]},{\"field\":\"organization_id\",\"op\":\"eq\",\"value\":\"507f1f77bcf86cd799439011\"}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(workspace_id|organization_id|version|reported_at|install_location|installed_at):(asc|desc)$"
            },
            "description": "Expressió de ordenament amb el format <field>:asc|desc"
          }
        ],
        "responses": {
          "200": {
            "description": "Observacions de Workspace d'app instal·lada obtingudes correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetInstalledAppWorkspacesResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Observacions de Workspace paginades",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "workspace_id": "64f0c2a1b2d3e4f5060708f1",
                          "organization_id": "507f1f77bcf86cd799439011",
                          "version": "124.0.2478.97",
                          "reported_at": "2026-01-15T10:20:30.000Z",
                          "install_location": "C:\\Program Files\\ExampleApp",
                          "installed_at": "2025-12-01T08:00:00.000Z"
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No s'han trobat observacions de Workspace",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de solicitud invàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filters no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filters invalido",
                        "code": "bad_request",
                        "details": "filters debe ser una expresion de filtro JSON valida"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No s'ha trobat l'app instal·lada dins de l'abast d'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "installed_app_not_found": {
                    "summary": "No s'ha trobat l'app instal·lada sol·licitada",
                    "value": {
                      "error": {
                        "message": "No se encontro la app instalada",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/installed-apps": {
      "get": {
        "tags": [
          "Aplicacions instal·lades"
        ],
        "summary": "Llistar aplicacions instal·lades",
        "description": "Retorna una llista paginada d'aplicacions instal·lades disponibles en l'abast de l'organització.",
        "operationId": "get_installed_apps",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps de l'element de resposta separats per comes que s'inclouran."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre els camps de filtre admesos.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom d'aplicació",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"chrome\"}"
              },
              "complex-and": {
                "summary": "Filtrar per sistema operatiu i presència d'instal·lació",
                "value": "{\"and\":[{\"field\":\"operating_system\",\"op\":\"eq\",\"value\":\"Windows\"},{\"field\":\"has_installations\",\"op\":\"eq\",\"value\":true}]}"
              },
              "complex-or-and": {
                "summary": "Combinar alternatives de publicador amb presència d'instal·lació",
                "value": "{\"and\":[{\"or\":[{\"field\":\"publisher\",\"op\":\"contains\",\"value\":\"microsoft\"},{\"field\":\"publisher\",\"op\":\"contains\",\"value\":\"google\"}]},{\"field\":\"has_installations\",\"op\":\"eq\",\"value\":true}]}"
              }
            }
          },
          {
            "name": "aggregate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Expressió d'agregació JSON amb `group_by` i `aggregates`. No es pot combinar amb `fields`.",
            "examples": {
              "group_by_operating_system": {
                "summary": "Agrupar per sistema operatiu i comptar",
                "value": "{\"group_by\":[\"operating_system\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}"
              },
              "group_by_publisher_avg_installations": {
                "summary": "Agrupar per publicador i calcular mitjana d'instal·lacions",
                "value": "{\"group_by\":[\"publisher\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"},{\"field\":\"installations\",\"function\":\"avg\"}]}"
              }
            }
          },
          {
            "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>`)."
          }
        ],
        "responses": {
          "200": {
            "description": "Aplicacions instal·lades recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetInstalledAppsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb aplicacions instal·lades",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f5060708c1",
                          "organization_id": "507f1f77bcf86cd799439011",
                          "name": "Microsoft Edge",
                          "discovered_at": "2026-03-10T09:00:00Z",
                          "reported_at": "2026-03-15T09:45:11Z",
                          "operating_system": "windows",
                          "publisher": "Microsoft Corporation",
                          "installations": 4
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No s'han trobat aplicacions instal·lades",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no válido",
                        "code": "bad_request",
                        "details": "filters debe ser un JSON válido"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "El recurs sol·licitat no es va trobar dins de l'abast autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "resource_not_found": {
                    "summary": "No s'ha trobat el recurs sol·licitat",
                    "value": {
                      "error": {
                        "message": "No encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/me": {
      "get": {
        "tags": [
          "Autenticació"
        ],
        "summary": "Validar token i obtenir el context actual",
        "description": "Valida el token i retorna el context autenticat.",
        "operationId": "get_me",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Context autenticat recuperat correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetMeResponseV2"
                },
                "examples": {
                  "authenticated_context": {
                    "summary": "Context d'organització i token",
                    "value": {
                      "organization_id": "507f1f77bcf86cd799439011",
                      "token_id": "507f1f77bcf86cd799439022",
                      "token_name": "api-key-admin",
                      "token_created_at": "2026-03-01T10:15:00Z",
                      "token_expires_at": "2027-03-01T10:15:00Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token invàlid, caducat o absent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_token": {
                    "summary": "Error d'autenticació",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/microservices/{microservice_id}": {
      "get": {
        "tags": [
          "Microserveis"
        ],
        "summary": "Obtenir microservei per identificador",
        "operationId": "get_microservice_by_id",
        "description": "Retorna un microservei visible per a l'organització objectiu (designer o marketplace), amb estat d'habilitació i configuració habilitada quan existeixi.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització sobre la qual es consulta el microservei.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "microservice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del microservei a recuperar.",
            "example": "65f0d9f2b3c4d5e6f7080911"
          },
          {
            "name": "Accept-Language",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "default": "es-ES",
              "maxLength": 10
            },
            "description": "Idioma per resoldre camps multilingües a un únic valor per camp.",
            "example": "es-ES"
          }
        ],
        "responses": {
          "200": {
            "description": "Microservei recuperat correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetMicroserviceByIdResponseV2"
                },
                "examples": {
                  "microservicio_habilitado": {
                    "summary": "Microservei trobat amb configuració activada",
                    "value": {
                      "data": {
                        "id": "65f0d9f2b3c4d5e6f7080911",
                        "organization_id": "507f1f77bcf86cd799439011",
                        "name": "Antivirus Scan",
                        "description": "Escaneo programado de antivirus",
                        "category": "security",
                        "created_at": "2026-05-15T10:00:00Z",
                        "archived_at": null,
                        "type": "standard",
                        "context": "organization",
                        "is_ai_enhanced": false,
                        "enabled": true,
                        "enabled_configuration": {
                          "enabled_at": "2026-05-15T10:30:00Z",
                          "efficiency": 95,
                          "workspace_group_execution": "l1",
                          "individual_execution": "l3",
                          "end_user_execution_workspace_group_ids": [
                            "65f0d9f2b3c4d5e6f7080931",
                            "65f0d9f2b3c4d5e6f7080932"
                          ]
                        }
                      }
                    }
                  },
                  "microservicio_no_habilitado": {
                    "summary": "Microservei trobat sense configuració activada",
                    "value": {
                      "data": {
                        "id": "65f0d9f2b3c4d5e6f7080912",
                        "organization_id": "507f1f77bcf86cd799439011",
                        "name": "Patch Baseline",
                        "description": "Control de parches pendientes",
                        "category": "maintenance",
                        "created_at": "2026-05-16T12:00:00Z",
                        "archived_at": null,
                        "type": "standard",
                        "context": "organization",
                        "is_ai_enhanced": true,
                        "enabled": false,
                        "enabled_configuration": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de solicitud invàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "id_invalido": {
                    "summary": "Identificador de microservei invàlid",
                    "value": {
                      "error": {
                        "message": "Parametro microservice_id invalido",
                        "code": "bad_request"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Accés a organització no autoritzat",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Microservei no trobat dins l'abast autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "microservice_not_found": {
                    "summary": "Microservei no trobat",
                    "value": {
                      "error": {
                        "message": "No encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/microservices": {
      "get": {
        "tags": [
          "Microserveis"
        ],
        "summary": "Llistar microserveis d'una organització",
        "operationId": "get_microservices",
        "description": "Retorna un llistat paginat de microserveis visibles per a l'organització objectiu (pròpia o delegada segons els permisos del cridant), enriquit amb l'estat d'habilitació i la configuració associada quan existeixi. La resolució d'habilitació es realitza estrictament amb l'organization_id enviat en el camí.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització objectiu sobre la qual es consulta el catàleg; l'habilitació es verifica contra aquest mateix identificador.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "Accept-Language",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "default": "es-ES",
              "maxLength": 10
            },
            "description": "Idioma per resoldre els camps multilingües de la resposta a un únic valor per camp.",
            "example": "es-ES"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Quantitat d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Camps de resposta a incloure, separats per comes."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió JSON de filtres sobre camps filtrables del recurs.",
            "examples": {
              "simple": {
                "summary": "Filtre simple per nom",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"backup\"}"
              },
              "complex-and": {
                "summary": "Filtre compost amb AND",
                "value": "{\"and\":[{\"field\":\"type\",\"op\":\"eq\",\"value\":\"standard\"},{\"field\":\"context\",\"op\":\"eq\",\"value\":\"organization\"}]}"
              },
              "complex-or-and": {
                "summary": "Filtre compost amb OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"category\",\"op\":\"eq\",\"value\":\"security\"},{\"field\":\"category\",\"op\":\"eq\",\"value\":\"automation\"}]},{\"field\":\"name\",\"op\":\"contains\",\"value\":\"agent\"}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Microserveis recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetMicroservicesResponseV2"
                },
                "examples": {
                  "resultado_con_datos": {
                    "summary": "Llistat amb resultats",
                    "value": {
                      "has_next": false,
                      "data": [
                        {
                          "id": "65f0d9f2b3c4d5e6f7080911",
                          "organization_id": "507f1f77bcf86cd799439011",
                          "name": "Antivirus Scan",
                          "description": "Escaneo programado de antivirus",
                          "category": "security",
                          "created_at": "2026-05-15T10:00:00Z",
                          "archived_at": null,
                          "type": "standard",
                          "context": "organization",
                          "is_ai_enhanced": false,
                          "enabled": true,
                          "enabled_configuration": {
                            "enabled_at": "2026-05-15T10:30:00Z",
                            "efficiency": 95,
                            "workspace_group_execution": "l1",
                            "individual_execution": "l3",
                            "end_user_execution_workspace_group_ids": [
                              "65f0d9f2b3c4d5e6f7080931",
                              "65f0d9f2b3c4d5e6f7080932"
                            ]
                          }
                        },
                        {
                          "id": "65f0d9f2b3c4d5e6f7080912",
                          "organization_id": "507f1f77bcf86cd799439011",
                          "name": "Patch Baseline",
                          "description": "Control de parches pendientes",
                          "category": "maintenance",
                          "created_at": "2026-05-16T12:00:00Z",
                          "archived_at": null,
                          "type": "standard",
                          "context": "organization",
                          "is_ai_enhanced": true,
                          "enabled": false,
                          "enabled_configuration": null
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud invàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "filters_invalido": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros inválido",
                        "code": "bad_request",
                        "details": "El parámetro filters debe ser una cadena JSON válida."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Accés a organització no autoritzat",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No s'ha trobat el recurs sol·licitat dins l'abast autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "resource_not_found": {
                    "summary": "Recurs no trobat",
                    "value": {
                      "error": {
                        "message": "No encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/operations/{operation_id}": {
      "get": {
        "tags": [
          "Operacions"
        ],
        "summary": "Obtenir detall d'una operació",
        "operationId": "get_operation_by_id",
        "description": "Retorna el detall públic d'una operació existent a l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'operació.",
            "example": "64f0c2a1b2d3e4f506070811"
          }
        ],
        "responses": {
          "200": {
            "description": "Operació recuperada correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOperationByIdResponseV2"
                },
                "examples": {
                  "operation_detail": {
                    "summary": "Detall d'operació",
                    "value": {
                      "id": "64f0c2a1b2d3e4f506070811",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "name": "remote_assistance",
                      "description": "Operación de asistencia remota",
                      "status": "finished",
                      "created_at": "2026-03-10T09:11:45Z",
                      "started_at": "2026-03-10T09:12:00Z",
                      "ended_at": "2026-03-10T09:15:17Z",
                      "microservice_id": "64f0c2a1b2d3e4f506070833",
                      "flow_id": "64f0c2a1b2d3e4f506070844",
                      "remote_support": {
                        "start_date": "2026-03-10T09:12:00Z",
                        "end_date": "2026-03-10T09:15:17Z",
                        "type": "unattended"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de camí no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_identifier": {
                    "summary": "Identificador amb format invàlid",
                    "value": {
                      "error": {
                        "message": "El identificador de operación no es válido",
                        "code": "bad_request",
                        "details": "operation_id debe tener 24 caracteres hexadecimales en minúscula."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Operació no trobada a l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Operació inexistent",
                    "value": {
                      "error": {
                        "message": "Operación no encontrada",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/operations/{operation_id}/results": {
      "get": {
        "tags": [
          "Operacions"
        ],
        "summary": "Obtenir resultats d'una operació",
        "operationId": "get_operation_results",
        "description": "Retorna resultats paginats d'execució per a una operació dins de l'organització autoritzada.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'operació.",
            "example": "64f0c2a1b2d3e4f506070811"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": "Pàgina a consultar."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Llista separada per comes amb camps de resposta a incloure.",
            "example": "id,workspace_id,status,name,start_date,end_date"
          },
          {
            "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>`).",
            "example": "start_date:desc"
          },
          {
            "name": "aggregate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Expressió JSON per a agregació. Estructura: {\"group_by\":[\"field\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}. No es pot combinar amb `fields`.",
            "examples": {
              "group-by-status-count": {
                "summary": "Agrupa per estat i compta",
                "value": "{\"group_by\":[\"status\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}"
              },
              "group-by-status-avg-script-duration": {
                "summary": "Agrupar per estat i calcular mitjana",
                "value": "{\"group_by\":[\"status\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"},{\"field\":\"script_duration\",\"function\":\"avg\"}]}"
              }
            }
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Expressió JSON de filtres sobre camps permesos.",
            "examples": {
              "simple": {
                "summary": "Filtre simple per nom de màquina",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"srv\"}"
              },
              "complex-and": {
                "summary": "Filtre compost amb condicions AND",
                "value": "{\"and\":[{\"field\":\"status\",\"op\":\"eq\",\"value\":\"completed\"},{\"field\":\"name\",\"op\":\"contains\",\"value\":\"win\"}]}"
              },
              "complex-or-and": {
                "summary": "Filtre compost amb OR nidificat i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"status\",\"op\":\"eq\",\"value\":\"error\"},{\"field\":\"status\",\"op\":\"eq\",\"value\":\"timeout\"}]},{\"field\":\"name\",\"op\":\"contains\",\"value\":\"desk\"}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultats recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOperationResultsResponseV2"
                },
                "examples": {
                  "results_page": {
                    "summary": "Pàgina de resultats de l'operació",
                    "value": {
                      "data": [
                        {
                          "id": "66b5f6d2f8d5a4d8a7f1c101",
                          "operation_id": "64f0c2a1b2d3e4f506070811",
                          "workspace_id": "66b5f6d2f8d5a4d8a7f1c301",
                          "organization_id": "507f1f77bcf86cd799439011",
                          "status": "completed",
                          "name": "ws-001",
                          "start_date": "2026-05-10T10:15:30Z",
                          "end_date": "2026-05-10T10:16:41Z",
                          "script_detail": "Script ejecutado correctamente",
                          "script_duration": 71,
                          "script_response": [
                            {
                              "timestamp": "2026-05-10T10:15:35.100Z",
                              "line": "Linea inicial\nDetalle multilinea"
                            },
                            {
                              "timestamp": "2026-05-10T10:15:37.100Z",
                              "line": "Segundo bloque OUT"
                            }
                          ]
                        }
                      ],
                      "has_next": true
                    }
                  },
                  "aggregated_by_status": {
                    "summary": "Resultat agregat per estat",
                    "value": {
                      "has_next": false,
                      "data": [
                        {
                          "status": "completed",
                          "count": 120,
                          "avg_script_duration": 17.4
                        },
                        {
                          "status": "error",
                          "count": 45,
                          "avg_script_duration": 3.1
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de consulta invàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_parameters": {
                    "summary": "Error de validació de paràmetres",
                    "value": {
                      "error": {
                        "message": "Parámetros de consulta inválidos",
                        "code": "BAD_REQUEST"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Fallo d'autorització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Operació no trobada a l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Operació inexistent",
                    "value": {
                      "error": {
                        "message": "Operación no encontrada",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/entity-limits": {
      "get": {
        "tags": [
          "Organització"
        ],
        "summary": "Veure límits d'entitats",
        "operationId": "get_organization_entity_limits",
        "description": "Retorna els límits de creació per tipus d'entitat per a l'organització sol·licitada. Aquests valors indiquen quants recursos de cada tipus pot crear l'organització.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització objectiu.",
            "example": "507f1f77bcf86cd799439011"
          }
        ],
        "responses": {
          "200": {
            "description": "Límits d'entitats recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOrganizationEntityLimitsResponseV2"
                },
                "examples": {
                  "ok_response": {
                    "summary": "Límits efectius per tipus d'entitat",
                    "value": {
                      "organization_id": "507f1f77bcf86cd799439011",
                      "limits": {
                        "tenants": 100,
                        "reporting_groups": 500,
                        "workspace_groups": 1000,
                        "workspace_group_schedules_per_group": 10,
                        "flows": 100,
                        "microservices": 500,
                        "reports": 500,
                        "webapps": 100,
                        "webhooks": 100,
                        "licenses": 500,
                        "alert_settings": 100,
                        "roles": 100,
                        "users": 1500,
                        "patching_policies": 50,
                        "patching_targets": 50,
                        "policies": 50,
                        "microservice_categories": 100,
                        "domains": 5,
                        "sso_integrations": 5,
                        "product_configs": 15,
                        "modules": 50,
                        "api_keys": 15
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud invàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o sense accés a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Organització no trobada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/patch-policy-targets": {
      "get": {
        "tags": [
          "Objectius de política de parxes"
        ],
        "summary": "Llistar objectius de política de pedaços",
        "operationId": "listPatchPolicyTargets",
        "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,
              "minimum": 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"
            },
            "description": "Camp de ordenació amb sufix d'ordre opcional (:asc o :desc). Useu els noms de les propietats de la resposta. Camps vàlids: id, name, created_at, timezone, should_restart, wake_on_lan, force_patching_configuration, is_in_maintenance, patch_policy_target_type. Exemple: \"name:asc\" o \"created_at:desc\""
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Llista de camps separada per comes per incloure en cada element d'objectiu de política de pedaços. Camps seleccionables: id, name, created_by, created_at, timezone, should_restart, wake_on_lan, force_patching_configuration, is_in_maintenance, weeks, schedule, patch_policy_target_type, patch_policy_id. El camp id sempre s'inclou.",
            "example": "name,timezone,patch_policy_id"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Filtre objectius de política de parxes per un o més criteris. Proporcioneu un objecte JSON amb condicions de filtre. Es pot filtrar per qualsevol camp retornat en la resposta. Useu operadors de comparació (eq, ne, gt, gte, lt, lte, in, nin, contains, startsWith, endsWith, between) i combineu múltiples condicions amb operadors lògics (and, or). Longitud màxima: 5120 caràcters.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom de l'objectiu",
                "description": "Retorna objectius de política de pegats el nom dels quals conté el text proporcionat.",
                "value": "{\"field\": \"name\", \"op\": \"contains\", \"value\": \"Base\"}"
              },
              "complex-and": {
                "summary": "Filtrar per tipus d'objectiu i comportament de reinici",
                "description": "Retorna objectius de Windows que requereixen reinici després de l'aplicació de pegats.",
                "value": "{\"and\": [{\"field\": \"patch_policy_target_type\", \"op\": \"eq\", \"value\": \"windows\"}, {\"field\": \"should_restart\", \"op\": \"eq\", \"value\": true}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "description": "Coincideix amb múltiples zones horàries i exclou objectius en manteniment.",
                "value": "{\"and\": [{\"or\": [{\"field\": \"timezone\", \"op\": \"eq\", \"value\": \"UTC\"}, {\"field\": \"timezone\", \"op\": \"eq\", \"value\": \"America/New_York\"}]}, {\"field\": \"is_in_maintenance\", \"op\": \"eq\", \"value\": false}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Llista paginada d'objectius de política de parxes recuperada correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatchPolicyTargetV2ListResponseV2"
                },
                "examples": {
                  "single-target": {
                    "summary": "Objectiu de política de parxes únic",
                    "value": {
                      "has_next": false,
                      "data": [
                        {
                          "id": "66ab6cf4d4d2e709bafd404c",
                          "name": "Base",
                          "created_by": "6439606652fc0c0051f1787b",
                          "created_at": "2024-08-01T11:09:40.719Z",
                          "timezone": "UTC",
                          "should_restart": true,
                          "wake_on_lan": true,
                          "force_patching_configuration": false,
                          "is_in_maintenance": false,
                          "weeks": [
                            1,
                            2
                          ],
                          "schedule": {
                            "MONDAY": {},
                            "TUESDAY": {},
                            "WEDNESDAY": {},
                            "THURSDAY": {
                              "9": [
                                15,
                                30,
                                45
                              ],
                              "10": [
                                0,
                                15,
                                30,
                                45
                              ],
                              "11": [
                                0,
                                15,
                                30,
                                45
                              ],
                              "12": [
                                0,
                                15,
                                30,
                                45
                              ],
                              "13": [
                                0,
                                15,
                                30,
                                45
                              ],
                              "14": [
                                0,
                                15,
                                30,
                                45
                              ],
                              "15": [
                                0
                              ]
                            },
                            "FRIDAY": {},
                            "SATURDAY": {},
                            "SUNDAY": {}
                          },
                          "patch_policy_target_type": "windows",
                          "patch_policy_id": "507f1f77bcf86cd799439011"
                        }
                      ]
                    }
                  },
                  "multiple-targets": {
                    "summary": "Múltiples objectius de política de parxes",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "66ab6cf4d4d2e709bafd404c",
                          "name": "Base",
                          "created_by": "6439606652fc0c0051f1787b",
                          "created_at": "2024-08-01T11:09:40.719Z",
                          "timezone": "UTC",
                          "should_restart": true,
                          "wake_on_lan": true,
                          "force_patching_configuration": false,
                          "is_in_maintenance": false,
                          "weeks": [
                            1,
                            2
                          ],
                          "schedule": {
                            "MONDAY": {},
                            "TUESDAY": {},
                            "WEDNESDAY": {},
                            "THURSDAY": {
                              "9": [
                                15,
                                30,
                                45
                              ],
                              "10": [
                                0,
                                15,
                                30,
                                45
                              ]
                            },
                            "FRIDAY": {},
                            "SATURDAY": {},
                            "SUNDAY": {}
                          },
                          "patch_policy_target_type": "windows",
                          "patch_policy_id": "507f1f77bcf86cd799439011"
                        },
                        {
                          "id": "66ab6cf4d4d2e709bafd404d",
                          "name": "Linux Base",
                          "created_by": "6439606652fc0c0051f1787b",
                          "created_at": "2024-08-02T10:00:00.000Z",
                          "timezone": "America/New_York",
                          "should_restart": false,
                          "wake_on_lan": false,
                          "force_patching_configuration": true,
                          "is_in_maintenance": false,
                          "weeks": [
                            1
                          ],
                          "schedule": {
                            "MONDAY": {
                              "8": [
                                0,
                                30
                              ]
                            },
                            "TUESDAY": {},
                            "WEDNESDAY": {},
                            "THURSDAY": {},
                            "FRIDAY": {},
                            "SATURDAY": {},
                            "SUNDAY": {}
                          },
                          "patch_policy_target_type": "linux",
                          "patch_policy_id": "507f1f77bcf86cd799439012"
                        }
                      ]
                    }
                  },
                  "empty-list": {
                    "summary": "Llista buida quan no existeixen objectius",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  },
                  "no-patch-policy": {
                    "summary": "Objectiu sense política de parxes assignada",
                    "value": {
                      "has_next": false,
                      "data": [
                        {
                          "id": "66ab6cf4d4d2e709bafd404c",
                          "name": "Base",
                          "created_by": "6439606652fc0c0051f1787b",
                          "created_at": "2024-08-01T11:09:40.719Z",
                          "timezone": "UTC",
                          "should_restart": true,
                          "wake_on_lan": true,
                          "force_patching_configuration": false,
                          "is_in_maintenance": false,
                          "weeks": [
                            1,
                            2
                          ],
                          "schedule": {
                            "MONDAY": {},
                            "TUESDAY": {},
                            "WEDNESDAY": {},
                            "THURSDAY": {},
                            "FRIDAY": {},
                            "SATURDAY": {},
                            "SUNDAY": {}
                          },
                          "patch_policy_target_type": null,
                          "patch_policy_id": null
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Paginació, ordenació o filtres no vàlids."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat: l'usuari no té accés a l'organització, o l'organització no existeix"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Recupera una llista paginada d'objectius de política de parxes per a una organització. Admet paginació, ordenació i filtrat mitjançant una cadena de filtres JSON. Els objectius de política de parxes defineixen quan i com s'apliquen els parxes als Workspaces."
      }
    },
    "/v2/organizations/{organization_id}/product-configs": {
      "get": {
        "tags": [
          "Configuracions de producte"
        ],
        "summary": "Llistar configuracions de producte",
        "operationId": "listProductConfigs",
        "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,
              "minimum": 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àxim: 100)"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Camp de ordenació amb sufix d'ordre opcional (:asc o :desc). Usa els noms de propietats de la resposta. Camps vàlids: id, environment, created_at, active, product_id, region. Exemple: \"product_id:asc\" o \"created_at:desc\""
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Llista separada per comes de camps per incloure en cada element de configuració de producte. Camps seleccionables: id, environment, created_at, active, product_id, region. El camp id sempre s'inclou.",
            "example": "environment,active,region"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Filtra configuracions de producte per un o més criteris. Proporciona un objecte JSON amb condicions de filtre. Pots filtrar per qualsevol camp retornat 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": "Filtrar per entorn",
                "description": "Retorna configuracions de producte per a un únic entorn.",
                "value": "{\"field\": \"environment\", \"op\": \"eq\", \"value\": \"PRODUCTION\"}"
              },
              "complex-and": {
                "summary": "Filtrar per estat i regió",
                "description": "Retorna configuracions de producte actives en una regió específica.",
                "value": "{\"and\": [{\"field\": \"active\", \"op\": \"eq\", \"value\": true}, {\"field\": \"region\", \"op\": \"eq\", \"value\": \"us-east\"}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "description": "Coincideix amb múltiples entorns i restringeix per producte.",
                "value": "{\"and\": [{\"or\": [{\"field\": \"environment\", \"op\": \"eq\", \"value\": \"PRODUCTION\"}, {\"field\": \"environment\", \"op\": \"eq\", \"value\": \"STAGING\"}]}, {\"field\": \"product_id\", \"op\": \"eq\", \"value\": \"507f1f77bcf86cd799439001\"}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Llista paginada de configuracions de producte recuperada correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductConfigV2ListResponseV2"
                },
                "examples": {
                  "single-config": {
                    "summary": "Configuració de producte única",
                    "value": {
                      "has_next": false,
                      "data": [
                        {
                          "id": "507f1f77bcf86cd799439011",
                          "environment": "PRODUCTION",
                          "created_at": "2024-01-15T10:30:00.000Z",
                          "active": true,
                          "product_id": "507f1f77bcf86cd799439001",
                          "region": "us-east"
                        }
                      ]
                    }
                  },
                  "multiple-configs": {
                    "summary": "Múltiples configuracions de producte",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "507f1f77bcf86cd799439011",
                          "environment": "PRODUCTION",
                          "created_at": "2024-01-15T10:30:00.000Z",
                          "active": true,
                          "product_id": "507f1f77bcf86cd799439001",
                          "region": "us-east"
                        },
                        {
                          "id": "507f1f77bcf86cd799439012",
                          "environment": "STAGING",
                          "created_at": "2024-01-20T14:45:00.000Z",
                          "active": false,
                          "product_id": "507f1f77bcf86cd799439001",
                          "region": null
                        }
                      ]
                    }
                  },
                  "empty-list": {
                    "summary": "Llista buida quan no existeixen configuracions",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Paginació, ordenament o filtres invàlids."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat: l'usuari no té accés a l'organització o l'organització no existeix"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Recupera una llista paginada de configuracions de producte per a l'organització especificada. Torna un arranjament d'objectes de configuració de producte que conté detalls de configuració, inclosos entorn, estat, informació del producte i regió. Admet paginació, ordenament i filtrat mitjançant una cadena de filtre JSON."
      }
    },
    "/v2/organizations/{organization_id}/reporting-groups/{reporting_group_id}/agent-versions/catalog": {
      "get": {
        "tags": [
          "Grups de report"
        ],
        "summary": "Obtenir catàleg de versions d'agent",
        "operationId": "get_reporting_group_agent_versions_catalog",
        "description": "Retorna el catàleg de versions permeses d'agent per al grup de reporte seleccionat.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització objectiu.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "reporting_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del grup de reporte objectiu.",
            "example": "507f1f77bcf86cd799439022"
          }
        ],
        "responses": {
          "200": {
            "description": "Catàleg de versions recuperat correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetReportingGroupAgentVersionsCatalogResponseV2"
                },
                "examples": {
                  "ok_response": {
                    "summary": "Catàleg per plataformes",
                    "value": {
                      "windows_cp": [
                        "2.30.4"
                      ],
                      "windows": [
                        "2.31.1",
                        "2.30.4"
                      ],
                      "macos": [
                        "1.10.0"
                      ],
                      "linux": [
                        "1.12.0"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Paràmetres invàlids."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat."
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup de reporte no trobat."
          },
          "409": {
            "$ref": "#/components/responses/Conflict",
            "description": "El grup no permet autogestió de versions d'agent."
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/reporting-groups/{reporting_group_id}/agent-versions": {
      "get": {
        "tags": [
          "Grups de report"
        ],
        "summary": "Obtenir configuració de versions d'agent",
        "operationId": "get_reporting_group_agent_versions",
        "description": "Retorna la configuració efectiva de versions d'agent per al grup de reporte sol·licitat. Aquest endpoint només està disponible quan el grup de reporte té assignada una configuració de producte amb autogestió de versions habilitada; en cas contrari retorna 409. L'habilitació d'aquesta capacitat és una configuració de plataforma gestionada fora del client API. El llistat de reporting groups informa d'aquesta capacitat mitjançant el camp \"can_manage_agent_versions\". Per a lectura amb API key es requereix el permís \"Equip de L3 d'enginyeria\" o el rol \"Administrador d'organització\".",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització objectiu.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "reporting_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del grup de reporte objectiu.",
            "example": "507f1f77bcf86cd799439022"
          }
        ],
        "responses": {
          "200": {
            "description": "Versions d'agent recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetReportingGroupAgentVersionsResponseV2"
                },
                "examples": {
                  "ok_response": {
                    "summary": "Versions efectives del grup",
                    "value": {
                      "agent_auto_update": true,
                      "versions": {
                        "windows_cp": {
                          "early": "latest",
                          "production": "latest"
                        },
                        "windows": {
                          "early": "2.20.0",
                          "production": "2.19.3"
                        },
                        "macos": {
                          "early": "latest",
                          "production": "1.9.2"
                        },
                        "linux": {
                          "early": "latest",
                          "production": "1.11.0"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Paràmetres de camí invàlids."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat."
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup de reporte no trobat."
          },
          "409": {
            "$ref": "#/components/responses/Conflict",
            "description": "El grup no permet autogestió de versions d'agent."
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "tags": [
          "Grups de report"
        ],
        "summary": "Actualitzar configuració de versions d'agent",
        "operationId": "update_reporting_group_agent_versions",
        "description": "Actualitza per substitució completa la configuració de versions d'agent per al grup de reporte sol·licitat. Aquest endpoint només està disponible quan el grup de reporte té assignada una configuració de producte amb autogestió de versions habilitada; en cas contrari retorna 409. L'habilitació d'aquesta capacitat és una configuració de plataforma gestionada fora del client API. El llistat de reporting groups informa d'aquesta capacitat mitjançant el camp \"can_manage_agent_versions\". Per a actualització amb API key es requereix el rol \"Administrador d'organització\".",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització objectiu.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "reporting_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del grup de reporte objectiu.",
            "example": "507f1f77bcf86cd799439022"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReportingGroupAgentVersionsRequestV2"
              },
              "examples": {
                "full_replacement": {
                  "summary": "Actualització completa",
                  "value": {
                    "agent_auto_update": false,
                    "versions": {
                      "windows_cp": {
                        "early": "latest",
                        "production": "latest"
                      },
                      "windows": {
                        "early": "2.31.0",
                        "production": "2.30.4"
                      },
                      "macos": {
                        "early": "latest",
                        "production": "1.10.0"
                      },
                      "linux": {
                        "early": "latest",
                        "production": "1.12.0"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Versions d'agent actualitzades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetReportingGroupAgentVersionsResponseV2"
                },
                "examples": {
                  "ok_response": {
                    "summary": "Versions actualitzades del grup",
                    "value": {
                      "agent_auto_update": false,
                      "versions": {
                        "windows_cp": {
                          "early": "latest",
                          "production": "latest"
                        },
                        "windows": {
                          "early": "2.31.0",
                          "production": "2.30.4"
                        },
                        "macos": {
                          "early": "latest",
                          "production": "1.10.0"
                        },
                        "linux": {
                          "early": "latest",
                          "production": "1.12.0"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Paràmetres de camí o cos invàlids."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat."
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup de reporte no trobat."
          },
          "409": {
            "$ref": "#/components/responses/Conflict",
            "description": "El grup no permet autogestió de versions d'agent."
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/reporting-groups/{reporting_group_id}/monthly-report/{period}": {
      "get": {
        "tags": [
          "Grups de report"
        ],
        "summary": "Obtenir informe mensual d'un grup d'informe",
        "description": "Retorna l'informe mensual de suport per al grup d'informe i el període sol·licitat, juntament amb les mètriques actuals del grup.",
        "operationId": "get_reportinggroup_monthly_report",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "reporting_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del grup d'informe.",
            "example": "507f1f77bcf86cd799439020"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}(0[1-9]|1[0-2])$",
              "minLength": 6,
              "maxLength": 6
            },
            "description": "Període mensual sol·licitat en format aaaamm.",
            "example": "202606"
          }
        ],
        "responses": {
          "200": {
            "description": "Informe mensual obtingut correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetReportingGroupMonthlyReportResponseV2"
                },
                "examples": {
                  "ok": {
                    "summary": "Resposta correcta",
                    "value": {
                      "reporting_group_id": "507f1f77bcf86cd799439020",
                      "organization_id": "507f1f77bcf86cd799439011",
                      "period_year": 2026,
                      "period_month": 6,
                      "applied_patches": 58,
                      "critical_patches": 6,
                      "security_patches": 17,
                      "other_patches": 35,
                      "total_used_apps": 42,
                      "top_apps": [
                        {
                          "app_name": "Google Chrome",
                          "usage_days": 21
                        },
                        {
                          "app_name": "Microsoft Teams",
                          "usage_days": 19
                        }
                      ],
                      "automatic_remediations": {
                        "microservices": 4,
                        "flows": 11
                      },
                      "current_reporting_group_name": "Madrid - Finance",
                      "current_total_workspaces": 132,
                      "current_total_workspace_users": 247,
                      "current_workspace_antivirus_statistics": {
                        "workspaces_without_antivirus": 9,
                        "workspaces_with_antivirus": {
                          "total": 123,
                          "by_status": {
                            "unknown": 5,
                            "not_installed": 7,
                            "installed_stopped": 3,
                            "installed_working": 108
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Sol·licitud invàlida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "period_invalid": {
                    "summary": "Període invàlid",
                    "value": {
                      "error": {
                        "message": "El parametro period debe tener formato yyyymm.",
                        "code": "invalid_request",
                        "details": "Use seis digitos con mes valido entre 01 y 12."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat per a aquesta organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "No autoritzat",
                    "value": {
                      "error": {
                        "message": "No autorizado.",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Informe mensual no trobat per al grup d'informe i el període indicat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "No trobat",
                    "value": {
                      "error": {
                        "message": "No se encontro el reporte mensual solicitado.",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "internal_error": {
                    "summary": "Error intern",
                    "value": {
                      "error": {
                        "message": "Se produjo un error interno.",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/sessions/{session_id}": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Recuperar una sessió",
        "operationId": "get_session_by_id",
        "description": "Torna detalls centrats en la sessió sol·licitada dins l'abast d'una organització.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "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": "Identificador de la sessió.",
            "example": "550E8400-E29B-41D4-A716-446655440000"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalls de la sessió recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSessionByIdResponseV2"
                },
                "examples": {
                  "session_details": {
                    "summary": "Resposta de detall de la sessió",
                    "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": "Paràmetres de solicitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_session_id": {
                    "summary": "Format d'identificador de sessió no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de session_id no valido",
                        "code": "bad_request",
                        "details": "session_id debe ser un UUID en mayusculas con formato 8-4-4-4-12"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Sessió no trobada dins el abast autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "session_not_found": {
                    "summary": "La sessió sol·licitada no va ser trobada",
                    "value": {
                      "error": {
                        "message": "Sesion no encontrada",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/sessions": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Llistar sessions",
        "operationId": "get_sessions",
        "description": "Torna una llista paginada de sessions de l'organització.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps d'elements de resposta separats per comes."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre rutes de camps de resposta filtrables.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom d'usuari",
                "value": "{\"field\":\"user_name\",\"op\":\"contains\",\"value\":\"jdoe\"}"
              },
              "complex-and": {
                "summary": "Filtrar per estat i estat de connexió",
                "value": "{\"and\":[{\"field\":\"session_status\",\"op\":\"eq\",\"value\":\"active\"},{\"field\":\"connection_state\",\"op\":\"eq\",\"value\":\"active\"}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"connection_state\",\"op\":\"eq\",\"value\":\"active\"},{\"field\":\"connection_state\",\"op\":\"eq\",\"value\":\"disconnected\"}]},{\"field\":\"current_dc_name\",\"op\":\"contains\",\"value\":\"dc-eu\"}]}"
              }
            }
          },
          {
            "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": "aggregate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Expressió JSON per a agregació. Estructura: {\"group_by\":[\"field\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}. No es pot combinar amb `fields`.",
            "examples": {
              "group-by-connection-state-count": {
                "summary": "Agrupar per estat de connexió i comptar",
                "value": "{\"group_by\":[\"connection_state\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}"
              },
              "group-by-platform-avg-cpu": {
                "summary": "Agrupa per plataforma i calcula mitjana",
                "value": "{\"group_by\":[\"platform_type\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"},{\"field\":\"cpu_usage\",\"function\":\"avg\"}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sessions recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSessionsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb sessions",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "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",
                          "cpu_usage": 34.2,
                          "ram_usage_gb": 3.8,
                          "rtt_usage": 18.1,
                          "session_status": "active",
                          "platform_type": "windows",
                          "connected": true,
                          "current_session_id": 41,
                          "current_dc_name": "dc-eu-01",
                          "current_uid_usage": 2.4,
                          "flexx_analyzer_executed": false,
                          "last_connection_time": "2026-03-15T09:45:11Z",
                          "log_on_duration": 35,
                          "number_alerts_user": 0,
                          "number_alerts_vm": 1,
                          "ram_usage": 3891,
                          "ram_percentage": 47,
                          "session_key": "6BA7B810-9DAD-11D1-80B4-00C04FD430C8",
                          "workspace_id": "64f0c2a1b2d3e4f5060708aa",
                          "organization_id": "507f1f77bcf86cd799439011"
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No s'han trobat sessions",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  },
                  "aggregated_by_connection_state": {
                    "summary": "Resultat agregat per estat de connexió",
                    "value": {
                      "has_next": false,
                      "data": [
                        {
                          "connection_state": "active",
                          "count": 120,
                          "avg_cpu_usage": 17.4
                        },
                        {
                          "connection_state": "disconnected",
                          "count": 45,
                          "avg_cpu_usage": 3.1
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud invàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros inválido",
                        "code": "bad_request",
                        "details": "filters debe ser una cadena JSON válida"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No s'ha trobat el recurs sol·licitat dins l'abast autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "resource_not_found": {
                    "summary": "No s'ha trobat el recurs sol·licitat",
                    "value": {
                      "error": {
                        "message": "No encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/workspace-groups/{workspace_group_id}/workspaces": {
      "get": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Espais de treball assignats",
        "operationId": "listWorkspaceGroupsWorkspaces",
        "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": "workspace_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de workspaces",
            "example": "507f1f77bcf86cd799439020"
          },
          {
            "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"
            },
            "description": "Camp d'ordenació amb sufix d'ordre opcional (:asc o :desc). Utilitza noms de propietats de la resposta: id, organization_id, name, related_environment, operating_system, ip_address, type, last_user, total_ram."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Llista separada per comes de camps per incloure en cada element Workspace. Camps seleccionables: id, organization_id, name, related_environment, operating_system, ip_address, type, last_user, total_ram. El camp id sempre s'inclou.",
            "example": "name,operating_system,total_ram"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120,
              "description": "Cadena JSON amb condicions de filtre. Usa noms de propietats de la resposta per als camps. Operadors: eq, ne, in, nin, gt, gte, lt, lte, contains, startsWith, endsWith, between. Combina amb and/or."
            },
            "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\": \"desktop\"}"
              },
              "complex-and": {
                "summary": "Filtra per sistema operatiu i RAM",
                "description": "Torna Workspaces amb Windows i almenys 8 GB de RAM.",
                "value": "{\"and\": [{\"field\": \"operating_system\", \"op\": \"contains\", \"value\": \"Windows\"}, {\"field\": \"total_ram\", \"op\": \"gte\", \"value\": 8192}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "description": "Coincideix amb dos prefixos de subxarxa i aplica un llindar de memòria.",
                "value": "{\"and\": [{\"or\": [{\"field\": \"ip_address\", \"op\": \"startsWith\", \"value\": \"172.\"}, {\"field\": \"ip_address\", \"op\": \"startsWith\", \"value\": \"10.\"}]}, {\"field\": \"total_ram\", \"op\": \"gt\", \"value\": 4096}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Llista paginada de Workspaces del grup de workspaces recuperada correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceGroupWorkspaceListResponseV2"
                }
              }
            }
          },
          "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": "Grup de workspaces no trobat o no pertany a l'organització"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "description": "Recupera una llista paginada de Workspaces que pertanyen al grup de workspaces especificat. Admet paginació, ordenació i filtrat mitjançant una cadena de filtres JSON. La resposta inclou un conjunt reduït de camps de Workspace."
      },
      "put": {
        "tags": [
          "Grups de Workspaces"
        ],
        "summary": "Establir o actualitzar espais de treball",
        "operationId": "updateWorkspaceGroupsWorkspace",
        "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": "workspace_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "L'identificador únic del grup de workspaces",
            "example": "507f1f77bcf86cd799439020"
          }
        ],
        "responses": {
          "200": {
            "description": "Workspaces actualitzats correctament en el grup de workspaces. Torna un resum del resultat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateWorkspaceGroupWorkspacesResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "Sol·licitud incorrecta. Causes comunes: - Estructura del cos de la sol·licitud no vàlida - Format d'ID de Workspace no vàlid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized",
            "description": "No autoritzat: es requereix autenticació"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "Grup de workspaces no trobat o no pertanyent a l'organització"
          },
          "422": {
            "description": "Entitat no processable. Causes comunes: - Els IDs de Workspace no existeixen - Els Workspaces no pertanyen a l'organització - IDs de Workspace no vàlids",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspacesUpdateRequestV2"
              },
              "examples": {
                "set-workspaces-in-group": {
                  "summary": "Establir múltiples Workspaces en un grup de workspaces",
                  "value": {
                    "workspace_ids": [
                      "507f1f77bcf86cd799439030",
                      "507f1f77bcf86cd799439031"
                    ]
                  }
                },
                "remove-all-workspaces": {
                  "summary": "Eliminar tots els Workspaces del grup de workspaces proporcionant un arranjament buit",
                  "value": {
                    "workspace_ids": []
                  }
                },
                "set-single-workspace": {
                  "summary": "Establir un sol Workspace en un grup de workspaces",
                  "value": {
                    "workspace_ids": [
                      "507f1f77bcf86cd799439030"
                    ]
                  }
                }
              }
            }
          }
        },
        "description": "Estableix o reemplaça tots els Workspaces en el grup de workspaces especificat amb la llista proporcionada. Aquesta és una operació de reemplaçament, no una actualització incremental: tots els Workspaces existents es reemplaçen. Torna un resum amb el total de Workspaces en el grup després de l'actualització."
      }
    },
    "/v2/organizations/{organization_id}/workspaces": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Llistar espais de treball",
        "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/WorkspaceListResponseV2"
                },
                "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",
                          "created_at": "2023-12-18T11:26:11.11Z",
                          "last_deregistration_time": "2026-01-19T12:26:25.25Z",
                          "delete_scheduled_at": "2026-07-15T00:00:00.000Z",
                          "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"
          }
        },
        "description": "Recupera una llista paginada de Workspaces. Admet paginació, ordenació i filtratge mitjançant una cadena de filtre JSON."
      }
    },
    "/v2/organizations/{organization_id}/workspaces/{workspace_id}/agent-versions": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Llistar versions d'agents del workspace",
        "description": "Torna l'historial paginat de versions de l'agent per a un workspace dins d'una organització, exposant només discovered_at i version.",
        "operationId": "workspaces_agent_versions",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "description": "Identificador de la organització.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "example": "64b7f1a2c3d4e5f60718293a"
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "description": "Identificador del workspace",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "example": "64b7f1a2c3d4e5f60718293b"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Número de pàgina a consultar.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Quantitat d'elements per pàgina.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "description": "Camps de resposta a incloure, separats per comes.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Expressió d'ordenació amb el format <field>:asc|desc.",
            "schema": {
              "type": "string",
              "pattern": "^([a-z_]+):(asc|desc)$"
            }
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "description": "Expressió JSON de filtres sobre camps filtrables de la resposta.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "simple": {
                "summary": "Filtre simple per versió",
                "value": "{\"field\":\"version\",\"op\":\"contains\",\"value\":\"5.2\"}"
              },
              "complex_and": {
                "summary": "Filtre compost amb and",
                "value": "{\"and\":[{\"field\":\"version\",\"op\":\"contains\",\"value\":\"5.\"},{\"field\":\"discovered_at\",\"op\":\"contains\",\"value\":\"2026-06\"}]}"
              },
              "complex_or_and": {
                "summary": "Filtre compost amb or i and",
                "value": "{\"and\":[{\"or\":[{\"field\":\"version\",\"op\":\"eq\",\"value\":\"5.2.0\"},{\"field\":\"version\",\"op\":\"eq\",\"value\":\"5.2.1\"}]},{\"field\":\"discovered_at\",\"op\":\"contains\",\"value\":\"2026-06\"}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Llistat paginat de versions de l'agent del workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkspaceAgentVersionsResponseV2"
                },
                "examples": {
                  "success": {
                    "summary": "Resposta paginada correcta",
                    "value": {
                      "data": [
                        {
                          "discovered_at": "2026-06-18T10:20:30.000Z",
                          "version": "5.2.1"
                        },
                        {
                          "discovered_at": "2026-05-10T08:00:00.000Z",
                          "version": "5.1.9"
                        }
                      ],
                      "has_next": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud invàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Could not process filters",
                        "code": "BAD_REQUEST",
                        "details": "Operator \"contains\" is not allowed for field \"discovered_at\"."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat per accedir a l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unauthorized": {
                    "summary": "Credencials invàlides o sense accés",
                    "value": {
                      "error": {
                        "code": "unauthorized",
                        "message": "No autorizado para acceder a este recurso."
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Recurs no trobat dins de l'abast autoritzat.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "summary": "Workspace sense historial disponible",
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "No se encontro el recurso solicitado."
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "internal_error": {
                    "summary": "Error inesperat",
                    "value": {
                      "error": {
                        "code": "internal_error",
                        "message": "Se ha producido un error interno."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/workspaces/{workspace_id}/alerts": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Llistar alertes actives",
        "operationId": "workspaces_alerts",
        "description": "Retorna una llista paginada d'alertes actives per al Workspace seleccionat.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del Workspace.",
            "example": "507f1f77bcf86cd799439099"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps d'element de resposta separats per comes per incloure."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre rutes de camps de resposta filtrables.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom d'alerta",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"disk\"}"
              },
              "complex-and": {
                "summary": "Filtrar per severitat i informació",
                "value": "{\"and\":[{\"field\":\"severity\",\"op\":\"eq\",\"value\":\"critical\"},{\"field\":\"information\",\"op\":\"contains\",\"value\":\"cpu\"}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"name\",\"op\":\"contains\",\"value\":\"memory\"},{\"field\":\"description\",\"op\":\"contains\",\"value\":\"memory\"}]},{\"field\":\"severity\",\"op\":\"eq\",\"value\":\"warning\"}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Expressió d'ordenació amb el format <field>:asc|desc sobre rutes de camps escalars ordenables de la resposta."
          }
        ],
        "responses": {
          "200": {
            "description": "Alertes de Workspace recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkspaceAlertsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb alertes",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f506070811",
                          "name": "Uso alto de CPU",
                          "description": "El uso de CPU superó el umbral",
                          "severity": "critical",
                          "started_at": "2026-03-15T08:00:00Z",
                          "authorized_minutes": 30,
                          "notified_at": "2026-03-15T08:05:00Z",
                          "information": "El uso actual es 96%",
                          "threshold_unit_name": "percent",
                          "threshold_value": 90,
                          "element": "cpu",
                          "category": "performance"
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No es van trobar alertes",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud invàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros inválido",
                        "code": "bad_request",
                        "details": "filters debe ser una cadena JSON válida"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workspace no trobat dins l'àmbit de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "workspace_not_found": {
                    "summary": "Workspace no existeix en l'àmbit",
                    "value": {
                      "error": {
                        "message": "Workspace no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/workspaces/{workspace_id}/disks": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Llistar discos",
        "operationId": "workspaces_disks",
        "description": "Torna una llista paginada de discos de Workspace per al Workspace seleccionat.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del Workspace.",
            "example": "507f1f77bcf86cd799439099"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Quantitat d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps d'elements de resposta separats per comes per incloure."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre rutes de camps filtrables de la resposta.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom de disc",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"system\"}"
              },
              "complex-and": {
                "summary": "Filtrar per tipus de mitjà i estat de xifrat",
                "value": "{\"and\":[{\"field\":\"media_type\",\"op\":\"eq\",\"value\":\"SSD\"},{\"field\":\"encrypted\",\"op\":\"eq\",\"value\":\"encrypted\"}]}"
              },
              "complex-or-and": {
                "summary": "Combinar alternatives de localització amb condició d'unitat del SO",
                "value": "{\"and\":[{\"or\":[{\"field\":\"location\",\"op\":\"contains\",\"value\":\"C:\"},{\"field\":\"location\",\"op\":\"contains\",\"value\":\"D:\"}]},{\"field\":\"os_drive\",\"op\":\"eq\",\"value\":true}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Expressió d'ordenació en la forma <field>:asc|desc sobre rutes de camps escalares ordenables de la resposta."
          }
        ],
        "responses": {
          "200": {
            "description": "Discos del Workspace recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkspaceDisksResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb registres de discos",
                    "value": {
                      "has_next": false,
                      "data": [
                        {
                          "id": "cd607b6eb7d74f3990e62f0f",
                          "name": "D:",
                          "device_id": "\\\\.\\PHYSICALDRIVE1",
                          "encrypted": "not_encrypted",
                          "encryption_method": "None",
                          "location": "Integrated : Bus 0 : Device 14 : Function 0 : Adapter 0 : Port 3 : Target 2 : LUN 0",
                          "media_type": "NTFS",
                          "os_drive": false,
                          "partition": "Disk #1, Partition #0",
                          "physical_disk_size": 953869,
                          "total_size": 953866,
                          "used_size": 953333,
                          "volume_label": "Data"
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No s'han trobat discos",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de solicitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filters no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filters no valido",
                        "code": "bad_request",
                        "details": "filters debe ser una cadena JSON valida"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workspace no trobat dins l'abast autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "workspace_not_found": {
                    "summary": "El Workspace no existeix en l'abast",
                    "value": {
                      "error": {
                        "message": "Workspace no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/workspaces/{workspace_id}/installed-apps": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Llistar aplicacions instal·lades",
        "description": "Retorna una llista paginada d'aplicacions instal·lades per al Workspace seleccionat.",
        "operationId": "workspaces_installed_apps",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del Workspace.",
            "example": "507f1f77bcf86cd799439099"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps d'elements de resposta separats per comes per incloure."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre rutes de camps de resposta filtrables.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom del producte",
                "value": "{\"field\":\"product_name\",\"op\":\"contains\",\"value\":\"chrome\"}"
              },
              "complex-and": {
                "summary": "Filtrar per editor i versió",
                "value": "{\"and\":[{\"field\":\"publisher\",\"op\":\"contains\",\"value\":\"microsoft\"},{\"field\":\"version\",\"op\":\"contains\",\"value\":\"2026\"}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"product_name\",\"op\":\"contains\",\"value\":\"edge\"},{\"field\":\"product_name\",\"op\":\"contains\",\"value\":\"chrome\"}]},{\"field\":\"last_reported_at\",\"op\":\"eq\",\"value\":\"2026-03-15T09:45:11Z\"}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Expressió d'ordre en la forma <field>:asc|desc sobre rutes de camps escalars de resposta ordenables."
          }
        ],
        "responses": {
          "200": {
            "description": "Aplicacions instal·lades del Workspace recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkspaceInstalledAppsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb aplicacions instal·lades",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f506070815",
                          "product_name": "Microsoft Edge",
                          "publisher": "Microsoft Corporation",
                          "version": "124.0.2478.97",
                          "installed_at": "2026-03-12T14:10:20Z",
                          "install_location": "C:\\Program Files (x86)\\Microsoft\\Edge\\Application",
                          "last_reported_at": "2026-03-15T09:45:11Z"
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No s'han trobat aplicacions instal·lades",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de solicitud invàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres invàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros invalido",
                        "code": "bad_request",
                        "details": "filters debe ser una cadena JSON valida"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workspace no trobat dins l'àmbit de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "workspace_not_found": {
                    "summary": "El Workspace no existeix en l'abast",
                    "value": {
                      "error": {
                        "message": "Workspace no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/workspaces/{workspace_id}/operations": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Llistar operacions",
        "operationId": "workspaces_operations",
        "description": "Retorna una llista paginada d'operacions per al Workspace seleccionat.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de l'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de Workspace.",
            "example": "507f1f77bcf86cd799439099"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps d'elements de resposta separats per comes per incloure."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre rutes de camps filtrables del contracte d'operació.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom d'operació",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"remote\"}"
              },
              "complex-and": {
                "summary": "Filtrar per estat i rang d'inici",
                "value": "{\"and\":[{\"field\":\"status\",\"op\":\"eq\",\"value\":\"finished\"},{\"field\":\"started_at\",\"op\":\"gte\",\"value\":\"2026-03-10T00:00:00.000Z\"}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"name\",\"op\":\"contains\",\"value\":\"remote\"},{\"field\":\"description\",\"op\":\"contains\",\"value\":\"remote\"}]},{\"field\":\"created_at\",\"op\":\"gte\",\"value\":\"2026-03-01T00:00:00.000Z\"}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Expressió d'ordenació amb la forma <field>:asc|desc sobre rutes de camps escalars de resposta ordenables."
          }
        ],
        "responses": {
          "200": {
            "description": "Operacions de Workspace recuperades correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkspaceOperationsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb elements",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f506070811",
                          "organization_id": "507f1f77bcf86cd799439011",
                          "name": "remote_assistance",
                          "description": "Iniciar sesión de asistencia remota desatendida",
                          "status": "finished",
                          "started_at": "2026-03-10T09:12:00Z",
                          "ended_at": "2026-03-10T09:15:17Z",
                          "created_at": "2026-03-10T09:11:45Z",
                          "microservice_id": null,
                          "flow_id": null,
                          "remote_support": {
                            "start_date": "2026-03-10T09:12:00Z",
                            "end_date": "2026-03-10T09:15:17Z",
                            "type": "unattended"
                          }
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No es van trobar operacions",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no válido",
                        "code": "bad_request",
                        "details": "filters debe ser una cadena JSON válida"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workspace no trobat dins l'àmbit autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "workspace_not_found": {
                    "summary": "El Workspace no existeix en l'abast",
                    "value": {
                      "error": {
                        "message": "Workspace no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/workspaces/{workspace_id}/patches": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Llistar pegats d'un Workspace",
        "operationId": "workspaces_patches",
        "description": "Torna una llista paginada de pegats per a l'workspace seleccionat. Només aplica a workspaces amb platform_type `windows`.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del Workspace.",
            "example": "507f1f77bcf86cd799439099"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Camps de resposta a incloure, separats per comes."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre camps de l'item de la resposta (inclou `id`).",
            "examples": {
              "simple": {
                "summary": "Filtrar per títol",
                "value": "{\"field\":\"title\",\"op\":\"contains\",\"value\":\"security update\"}"
              },
              "complex-and": {
                "summary": "Filtrar per estat i severitat",
                "value": "{\"and\":[{\"field\":\"status\",\"op\":\"eq\",\"value\":\"pending\"},{\"field\":\"severity\",\"op\":\"contains\",\"value\":\"critical\"}]}"
              },
              "complex-or-and": {
                "summary": "Combinar OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"product\",\"op\":\"contains\",\"value\":\"windows 10\"},{\"field\":\"product\",\"op\":\"contains\",\"value\":\"windows 11\"}]},{\"field\":\"kb\",\"op\":\"contains\",\"value\":\"kb503\"}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^([a-z_]+):(asc|desc)$"
            },
            "description": "Expressió d'ordenació amb el format <field>:asc|desc sobre camps escalars de l'ítem (inclou `id`). En mode agregat, només accepta camps de `group_by` o àlies agregats (`count`, `<function>_<field>`)."
          },
          {
            "name": "aggregate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            },
            "description": "Expressió JSON d'agregació amb `group_by` i `aggregates` sobre camps escalars de primer nivell.",
            "examples": {
              "group_status_count": {
                "summary": "Agrupa per estat i compta",
                "value": "{\"group_by\":[\"status\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"}]}"
              },
              "group_product_avg": {
                "summary": "Agrupar per producte i calcular mitjana",
                "value": "{\"group_by\":[\"product\"],\"aggregates\":[{\"field\":\"*\",\"function\":\"count\"},{\"field\":\"installed_at\",\"function\":\"max\"}]}"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pegats de Workspace recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkspacePatchesResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Resultat paginat amb registres de pegats",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f506070812",
                          "kb": "KB5034123",
                          "title": "Actualizacion acumulativa de seguridad",
                          "status": "pending",
                          "product": "windows 11",
                          "severity": "critical",
                          "arrived_at": "2026-03-15",
                          "category": "security_updates",
                          "installed_at": null,
                          "additional_information_url": "https://support.microsoft.com/help/kb5034123"
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No s'han trobat pegats",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de solicitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no valido",
                        "code": "bad_request",
                        "details": "filters debe ser una cadena JSON valida"
                      }
                    }
                  },
                  "invalid_platform_type": {
                    "summary": "Workspace amb plataforma no compatible",
                    "value": {
                      "error": {
                        "message": "Workspace no compatible para consulta de parches",
                        "code": "bad_request",
                        "details": "Este endpoint solo admite workspaces con platform_type windows"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o organització no accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workspace no trobat dins l'àmbit de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "workspace_not_found": {
                    "summary": "Workspace no existeix en l'àmbit",
                    "value": {
                      "error": {
                        "message": "Workspace no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/workspaces/{workspace_id}/pnp-errors": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Llistar errors Plug and Play",
        "operationId": "workspaces_pnp_errors",
        "description": "Retorna una llista paginada d'errors Plug and Play pel Workspace seleccionat.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador d'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de Workspace.",
            "example": "507f1f77bcf86cd799439099"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps d'elements de resposta, separats per comes, que s'inclouran."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre rutes de camps de resposta filtrables.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom d'error",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"usb\"}"
              },
              "complex-and": {
                "summary": "Filtrar per estat i classe",
                "value": "{\"and\":[{\"field\":\"status\",\"op\":\"eq\",\"value\":\"error\"},{\"field\":\"class\",\"op\":\"contains\",\"value\":\"usb\"}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"error_code\",\"op\":\"eq\",\"value\":\"CM_PROB_FAILED_START\"},{\"field\":\"error_code\",\"op\":\"eq\",\"value\":\"CM_PROB_DISABLED\"}]},{\"field\":\"device_id\",\"op\":\"contains\",\"value\":\"ven_8086\"}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Expressió d'ordre amb el format <field>:asc|desc sobre rutes de camps escalars de resposta ordenables."
          }
        ],
        "responses": {
          "200": {
            "description": "Errors Plug and Play de Workspace recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkspacePnpErrorsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Resultat paginat amb errors Plug and Play",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f506070811",
                          "name": "Dispositivo compuesto USB",
                          "status": "Error",
                          "class": "USB",
                          "device_id": "USB\\VID_046D&PID_C534",
                          "error_description": "El controlador no pudo iniciarse",
                          "error_code": "CM_PROB_FAILED_START",
                          "properties": "driver_version=10.0.22621.1",
                          "last_updated_at": "2026-03-31T20:05:57Z"
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No s'han trobat errors Plug and Play",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no válido",
                        "code": "bad_request",
                        "details": "filters debe ser una cadena JSON válida"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workspace no trobat dins l'àmbit autoritzat de l'organització.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "workspace_not_found": {
                    "summary": "El Workspace no existeix en l'abast",
                    "value": {
                      "error": {
                        "message": "Workspace no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/workspaces/{workspace_id}/pnp-events": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Llistar esdeveniments Plug and Play",
        "operationId": "workspaces_pnp_events",
        "description": "Retorna una llista paginada d'esdeveniments Plug and Play pel Workspace seleccionat.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de la organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador del Workspace.",
            "example": "507f1f77bcf86cd799439099"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps d'elements de resposta separats per comes per incloure."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre rutes de camps de resposta filtrables.",
            "examples": {
              "simple": {
                "summary": "Filtrar per acció",
                "value": "{\"field\":\"action\",\"op\":\"contains\",\"value\":\"install\"}"
              },
              "complex-and": {
                "summary": "Filtrar per data i usuari",
                "value": "{\"and\":[{\"field\":\"created_at\",\"op\":\"contains\",\"value\":\"2026-03-31\"},{\"field\":\"user_name\",\"op\":\"contains\",\"value\":\"system\"}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"caption\",\"op\":\"contains\",\"value\":\"usb\"},{\"field\":\"caption\",\"op\":\"contains\",\"value\":\"driver\"}]},{\"field\":\"device_id\",\"op\":\"contains\",\"value\":\"ven_8086\"}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Expressió d'ordre en la forma <field>:asc|desc sobre rutes de camps escalars de resposta ordenables."
          }
        ],
        "responses": {
          "200": {
            "description": "Esdeveniments Plug and Play de Workspace recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkspacePnpEventsResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Resultat paginat amb registres d'esdeveniments",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f506070810",
                          "action": "Install",
                          "created_at": "2026-03-31T20:05:57Z",
                          "user_name": "SYSTEM",
                          "caption": "USB device installed",
                          "device_id": "PCI\\VEN_8086&DEV_9A13"
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No s'han trobat esdeveniments",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de solicitud no vàlids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filtres no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filtros no valido",
                        "code": "bad_request",
                        "details": "filters debe ser una cadena JSON valida"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o organització no accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workspace no trobat dins l'àmbit de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "workspace_not_found": {
                    "summary": "Workspace no existeix en l'àmbit",
                    "value": {
                      "error": {
                        "message": "Workspace no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/organizations/{organization_id}/workspaces/{workspace_id}/services": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Llistar serveis",
        "operationId": "workspaces_services",
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador d'organització.",
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{24}$",
              "minLength": 24,
              "maxLength": 24
            },
            "description": "Identificador de Workspace.",
            "example": "507f1f77bcf86cd799439099"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Número de pàgina."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Número d'elements per pàgina."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Noms de camps d'elements de resposta separats per comes per incloure."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 5120
            },
            "description": "Expressió de filtre JSON sobre rutes de camps de resposta filtrables.",
            "examples": {
              "simple": {
                "summary": "Filtrar per nom del servei",
                "value": "{\"field\":\"name\",\"op\":\"contains\",\"value\":\"print\"}"
              },
              "complex-and": {
                "summary": "Filtrar per estat i tipus d'inici",
                "value": "{\"and\":[{\"field\":\"status\",\"op\":\"eq\",\"value\":\"Running\"},{\"field\":\"startup_type\",\"op\":\"eq\",\"value\":\"Manual\"}]}"
              },
              "complex-or-and": {
                "summary": "Combina condicions OR i AND",
                "value": "{\"and\":[{\"or\":[{\"field\":\"display_name\",\"op\":\"contains\",\"value\":\"agent\"},{\"field\":\"description\",\"op\":\"contains\",\"value\":\"agent\"}]},{\"field\":\"accept_stop\",\"op\":\"eq\",\"value\":true}]}"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^([a-z_]+):(asc|desc)$"
            },
            "description": "Expressió d'ordenació amb format <field>:asc|desc sobre rutes de camps escalares de resposta ordenables."
          }
        ],
        "responses": {
          "200": {
            "description": "Serveis de Workspace recuperats correctament.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkspaceServicesResponseV2"
                },
                "examples": {
                  "paginated_result": {
                    "summary": "Llista paginada amb serveis",
                    "value": {
                      "has_next": true,
                      "data": [
                        {
                          "id": "64f0c2a1b2d3e4f506070810",
                          "name": "Spooler",
                          "description": "Carga archivos en memoria para el procesamiento de impresión.",
                          "status": "Running",
                          "accept_stop": true,
                          "display_name": "Print Spooler",
                          "log_on_as": "LocalSystem",
                          "path": "C:\\Windows\\System32\\spoolsv.exe",
                          "organization_id": "507f1f77bcf86cd799439011",
                          "reporting_group_id": "507f1f77bcf86cd799439077",
                          "startup_type": "Automatic",
                          "last_updated_at": "2026-03-15T09:45:11Z",
                          "workspace_id": "507f1f77bcf86cd799439099"
                        }
                      ]
                    }
                  },
                  "empty_result": {
                    "summary": "No s'han trobat serveis",
                    "value": {
                      "has_next": false,
                      "data": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Paràmetres de sol·licitud no vàlids, incloent-hi filtres/sort invàlids o Workspace no Windows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_filters": {
                    "summary": "Format de filters no vàlid",
                    "value": {
                      "error": {
                        "message": "Formato de filters no válido",
                        "code": "bad_request",
                        "details": "filters debe ser una cadena JSON válida"
                      }
                    }
                  },
                  "workspace_platform_not_supported": {
                    "summary": "Workspace no suportat per plataforma",
                    "value": {
                      "error": {
                        "message": "This endpoint supports only windows workspaces (platform_type=windows)",
                        "code": "bad_request"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No autoritzat o l'organització no és accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "organization_not_authorized": {
                    "summary": "Fallada d'accés a l'organització",
                    "value": {
                      "error": {
                        "message": "No autorizado",
                        "code": "unauthorized"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workspace no trobat dins de l'abast de l'organització autoritzada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "workspace_not_found": {
                    "summary": "Workspace no existeix en l'àmbit",
                    "value": {
                      "error": {
                        "message": "Workspace no encontrado",
                        "code": "not_found"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error intern del servidor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unexpected_error": {
                    "summary": "Fallada inesperada",
                    "value": {
                      "error": {
                        "message": "Error interno del servidor",
                        "code": "internal_error"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Torna una llista paginada de serveis per al Workspace seleccionat. Només aplica per a Workspaces Windows (platform_type=windows)."
      }
    }
  },
  "components": {
    "schemas": {
      "CreateDigitalActivityCoreProcessGroupRequestV2": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Nom del grup de processos core."
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Descripció opcional del grup de processos core."
          },
          "workspace_group_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del grup de workspaces associat."
          }
        },
        "required": [
          "name",
          "workspace_group_id"
        ],
        "description": "Cos de creació del grup de processos core."
      },
      "GetDigitalActivityCoreProcessGroupResponseV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del grup de processos core."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització."
          },
          "name": {
            "type": "string",
            "description": "Nom del grup de processos core."
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Descripció del grup de processos core."
          },
          "workspace_group_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del grup de workspaces associat."
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "workspace_group_id"
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "details": {
                "type": "string"
              }
            },
            "required": [
              "message",
              "code"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "FlowV2": {
        "type": "object",
        "description": "Detall del flux tal com el retorna GET flow by id. L'organització és implícita per la ruta `/v2/organizations/{organization_id}/flows/{flow_id}`. Els espais de treball/grups de destinació es normalitzen en target.ids (cadenes hexadecimals de ObjectId de MongoDB).",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string",
            "description": "Resol per Accept-Language quan és multilingüe"
          },
          "description": {
            "type": "string",
            "description": "Resol per Accept-Language quan és multilingüe"
          },
          "type": {
            "type": "string",
            "enum": [
              "session",
              "workspace"
            ]
          },
          "version": {
            "type": "number"
          },
          "detection_only": {
            "type": "boolean"
          },
          "cooldown_minutes": {
            "type": "number",
            "description": "Temps d'espera en minuts"
          },
          "enabled": {
            "type": "boolean"
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowConditionV2"
            },
            "description": "Omitit o buit quan el flux no té condicions"
          },
          "trigger": {
            "type": "string",
            "nullable": true
          },
          "target": {
            "$ref": "#/components/schemas/FlowTargetSelectorV2",
            "description": "Destí d'execució: el tipus selecciona l'abast; ids enumera valors de _id de Workspace, _id de grup de Workspace o _id de Grup de reporte (buit quan el tipus és ALL_WORKSPACES)"
          },
          "microservice_id": {
            "type": "string",
            "nullable": true,
            "description": "ID del microservei vinculat quan està present"
          },
          "init_text": {
            "type": "string",
            "nullable": true,
            "description": "Resol per Accept-Language quan és multilingüe"
          },
          "ok_text": {
            "type": "string",
            "nullable": true,
            "description": "Resol per Accept-Language quan és multilingüe"
          },
          "ko_text": {
            "type": "string",
            "nullable": true,
            "description": "Resol per Accept-Language quan és multilingüe"
          },
          "execution_metrics": {
            "$ref": "#/components/schemas/FlowExecutionMetricsV2",
            "nullable": true,
            "description": "Present quan es van calcular mètriques per a aquest flux"
          }
        },
        "required": [
          "id",
          "created_at",
          "name",
          "description",
          "type",
          "version",
          "detection_only",
          "cooldown_minutes",
          "enabled",
          "target"
        ]
      },
      "FlowConditionV2": {
        "type": "object",
        "properties": {
          "condition_type_id": {
            "type": "string"
          },
          "metric": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "compare_to": {
            "type": "string"
          },
          "period": {
            "type": "number",
            "nullable": true
          },
          "check_every": {
            "type": "number"
          }
        },
        "required": [
          "condition_type_id",
          "metric",
          "operator",
          "compare_to",
          "check_every"
        ]
      },
      "FlowTargetSelectorV2": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "all_workspaces",
              "workspaces",
              "workspace_groups",
              "reporting_groups"
            ],
            "description": "ALL_WORKSPACES: ids sempre és []. WORKSPACES: ids són _id de documents de Workspace (24 hex). WORKSPACE_GROUPS / REPORTING_GROUPS: ids són valors de _id de grup."
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            }
          }
        },
        "required": [
          "type",
          "ids"
        ]
      },
      "FlowExecutionMetricsV2": {
        "type": "object",
        "properties": {
          "targeted_workspaces": {
            "type": "number"
          },
          "evaluations_per_day": {
            "type": "number"
          },
          "possible_executions_per_day": {
            "type": "number"
          },
          "total_possible_executions_per_day": {
            "type": "number"
          }
        },
        "required": [
          "targeted_workspaces",
          "evaluations_per_day",
          "possible_executions_per_day",
          "total_possible_executions_per_day"
        ]
      },
      "MultilangField": {
        "type": "object",
        "description": "Camp multilingüe. Les claus són codis de idioma (en-EN, es-ES, pt-BR, eu-ES, ca-ES). Hi ha d'haver com a mínim una clau. Cada valor ha de tenir entre 1 i 512 caràcters.",
        "properties": {
          "en-EN": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "es-ES": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "pt-BR": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "eu-ES": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "ca-ES": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          }
        },
        "additionalProperties": false
      },
      "CreateFlowV2Request": {
        "type": "object",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/MultilangField",
            "description": "Nom del flux. Es requereix com a mínim una clau de idioma; cada valor ha de tenir entre 1 i 512 caràcters."
          },
          "description": {
            "$ref": "#/components/schemas/MultilangField",
            "description": "Descripció del flux. Es requereix com a mínim una clau de idioma; cada valor ha de tenir entre 1 i 512 caràcters."
          },
          "type": {
            "type": "string",
            "enum": [
              "session",
              "workspace"
            ]
          },
          "detection_only": {
            "type": "boolean"
          },
          "cooldown_minutes": {
            "type": "number",
            "minimum": 10,
            "maximum": 1440,
            "description": "Temps d'espera en minuts. Ha d'estar entre 10 i 1440."
          },
          "enabled": {
            "type": "boolean",
            "default": false,
            "description": "Si és cert, el flux queda habilitat després de la seva creació (requereix condicions, microservei i objectiu vàlids). Si se s'omete o és fals, es crea un flux deshabilitat."
          },
          "init_text": {
            "$ref": "#/components/schemas/MultilangField",
            "description": "Missatge de text inicial. Se s'omete si no és necessari. Quan es proporciona, es requereix com a mínim una clau de idioma; cada valor ha de tenir entre 1 i 512 caràcters."
          },
          "ok_text": {
            "$ref": "#/components/schemas/MultilangField",
            "description": "Missatge de text d'èxit. Se s'omete si no és necessari. Quan es proporciona, es requereix com a mínim una clau de idioma; cada valor ha de tenir entre 1 i 512 caràcters."
          },
          "ko_text": {
            "$ref": "#/components/schemas/MultilangField",
            "description": "Missatge de text d'error. Se s'omete si no és necessari. Quan es proporciona, es requereix com a mínim una clau de idioma; cada valor ha de tenir entre 1 i 512 caràcters."
          },
          "target": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "all_workspaces",
                  "workspaces",
                  "workspace_groups",
                  "reporting_groups"
                ]
              },
              "ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 512
                }
              }
            },
            "required": [
              "type"
            ]
          },
          "microservice_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$"
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowConditionInputV2"
            }
          }
        },
        "required": [
          "name",
          "description",
          "type",
          "detection_only",
          "cooldown_minutes",
          "target",
          "microservice_id",
          "conditions"
        ]
      },
      "FlowConditionInputV2": {
        "type": "object",
        "properties": {
          "condition_type_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$"
          },
          "operator": {
            "type": "string",
            "enum": [
              "eq",
              "gt",
              "lt",
              "gte",
              "lte",
              "startsWith",
              "endsWith",
              "contains",
              "at"
            ]
          },
          "compare_to": {
            "type": "string",
            "maxLength": 512
          },
          "period": {
            "type": "number",
            "nullable": true
          },
          "check_every": {
            "type": "number"
          }
        },
        "required": [
          "condition_type_id",
          "operator",
          "compare_to",
          "check_every"
        ]
      },
      "CreateOperationV2Request": {
        "type": "object",
        "required": [
          "type",
          "target"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "execute_microservice",
              "delete_workspaces",
              "shutdown_workspaces",
              "restart_workspaces",
              "suspend_workspaces"
            ]
          },
          "target": {
            "type": "object",
            "required": [
              "type",
              "ids"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "workspaces",
                  "sessions"
                ]
              },
              "ids": {
                "type": "array",
                "minItems": 1,
                "maxItems": 20000,
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                }
              }
            },
            "additionalProperties": false
          },
          "expiration_in_seconds": {
            "type": "integer",
            "maximum": 84600,
            "minimum": 600
          },
          "payload": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "CreateOperationV2Response": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/GetOperationByIdResponseV1"
            }
          }
        }
      },
      "GetOperationByIdResponseV1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'execució de l'operació."
          },
          "name": {
            "type": "string",
            "description": "Nom de l'operació."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització propietària de l'operació."
          },
          "description": {
            "type": "string",
            "description": "Descripció de l'operació. Es retorna cadena buida quan no existeix en origen."
          },
          "status": {
            "type": "string",
            "enum": [
              "finished",
              "unknown",
              "error",
              "pending",
              "in-progress",
              "timeout",
              "cancelled",
              "scheduled"
            ],
            "description": "Estat actual de l'operació."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Marca temporal de creació."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Marca temporal d'inici."
          },
          "ended_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Marca temporal de finalització."
          },
          "microservice_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del microservei relacionat, quan existeixi."
          },
          "flow_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del flux relacionat, quan existeixi."
          },
          "remote_support": {
            "$ref": "#/components/schemas/GetOperationByIdRemoteSupportV1"
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "description",
          "status",
          "created_at"
        ]
      },
      "GetOperationByIdRemoteSupportV1": {
        "type": "object",
        "nullable": true,
        "properties": {
          "start_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data d'inici del suport remot."
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data de finalització del suport remot."
          },
          "type": {
            "type": "string",
            "nullable": true,
            "description": "Tipus de sessió de suport remot."
          }
        }
      },
      "CreateReportingGroupMagicLinkRequestV2": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Data i hora d'expiració en UTC (ISO 8601, per exemple, amb sufix Z). Ha de ser en el futur i no més de 91 dies per davant.",
            "example": "2026-03-15T12:00:00.000Z"
          },
          "installer": {
            "$ref": "#/components/schemas/ReportingGroupMagicLinkInstallerV2"
          }
        },
        "required": [
          "expires_at",
          "installer"
        ],
        "description": "Cos de sol·licitud per crear un enllaç màgic de Grup de reporte."
      },
      "ReportingGroupMagicLinkInstallerV2": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "string",
            "enum": [
              "latest"
            ],
            "description": "Versió de l'instal·lador.",
            "example": "latest"
          },
          "platform": {
            "type": "string",
            "enum": [
              "windows"
            ],
            "description": "Plataforma de l'instal·lador.",
            "example": "windows"
          },
          "arch": {
            "type": "string",
            "enum": [
              "x64"
            ],
            "description": "Arquitectura de l'instal·lador.",
            "example": "x64"
          },
          "type": {
            "type": "string",
            "enum": [
              "fxxone"
            ],
            "description": "Tipus d'instal·lador.",
            "example": "fxxone"
          }
        },
        "required": [
          "version",
          "platform",
          "arch",
          "type"
        ],
        "description": "Selecció d'installador per a l'enllaç màgic."
      },
      "CreateReportingGroupMagicLinkResponseV2": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Identificador de l'enllaç màgic",
            "example": "507f1f77bcf86cd799439099"
          },
          "token": {
            "type": "string",
            "description": "Token associat amb l'enllaç màgic.",
            "example": "2ab46558-3c40-4b72-8fce-08b7b596f624"
          },
          "link": {
            "type": "string",
            "description": "URL de l'enllaç màgic.",
            "example": "https://portal.example.com/magic-link?key=2ab46558-3c40-4b72-8fce-08b7b596f624"
          }
        },
        "required": [
          "id",
          "token",
          "link"
        ]
      },
      "CreateReportingGroupRequestV2": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 512,
            "description": "El nom del grup de reporte. Ha de ser únic dins de l'organització.",
            "example": "Grupo de reporte de Producción"
          },
          "product_config_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "L'identificador únic de la configuració de producte que s'associarà amb aquest grup de reporte. La configuració de producte ha d'existir i pertànyer a l'organització.",
            "example": "507f1f77bcf86cd799439030"
          },
          "patch_policy_target_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Opcional. L'identificador únic del destí de política de pegats que s'associarà amb aquest grup de reporte.",
            "example": "507f1f77bcf86cd799439040"
          },
          "fishing_pattern": {
            "type": "string",
            "maxLength": 250,
            "description": "Opcional. Un patró d'expressió regular utilitzat per coincidir dispositius. Ha de ser un patró regex vàlid. Si es proporciona, també s'ha d'especificar fishing_pattern_field.",
            "example": "Estaciones de trabajo Windows"
          },
          "fishing_pattern_field": {
            "type": "string",
            "enum": [
              "full_name",
              "description",
              "ou",
              "current_subnet"
            ],
            "description": "Opcional. Camp sobre el qual s'aplica fishing_pattern. Obligatori si es proporciona fishing_pattern. Valors vàlids: full_name (nom complet del dispositiu), description (descripció del dispositiu), ou (unitat organitzativa), current_subnet (subxarxa actual).",
            "example": "full_name"
          },
          "intermediate_device_1_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Opcional. L'identificador únic del primer Workspace de dispositiu intermedi. Els dispositius intermedis s'utilitzen per a accions Wake on LAN en xarxes segures, permetent l'encesa remot de dispositius objectiu a través de passarel·les intermediàries. Els dispositius intermedis han de definir-se seqüencialment sense buits. Si es proporcionen intermediate_device_2_id o intermediate_device_3_id, aquest camp és obligatori.",
            "example": "507f1f77bcf86cd799439050"
          },
          "intermediate_device_2_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Opcional. L'identificador únic del segon Workspace de dispositiu intermedi. S'utilitza per accions Wake on LAN en xarxes segures. Requereix que es proporcioni intermediate_device_1_id. Si es proporciona intermediate_device_3_id, aquest camp és obligatori.",
            "example": "507f1f77bcf86cd799439051"
          },
          "intermediate_device_3_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Opcional. L'identificador únic del tercer Workspace de dispositiu intermedi. S'utilitza per accions Wake on LAN en xarxes segures. Requereix que es proporcionin intermediate_device_1_id i intermediate_device_2_id.",
            "example": "507f1f77bcf86cd799439052"
          }
        },
        "required": [
          "name",
          "product_config_id"
        ],
        "description": "Cos de sol·licitud per crear un nou grup de reporte. Els grups de reporte organitzen dispositius i gestionen configuracions, polítiques de pegats i enrutament de dispositius intermedis."
      },
      "ReportingGroupByIdV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID del grup de report"
          },
          "name": {
            "type": "string",
            "description": "Nom del grup de report"
          },
          "organization_id": {
            "type": "string",
            "nullable": true,
            "description": "Identificador de l'organització"
          },
          "product_config_id": {
            "type": "string",
            "nullable": true,
            "description": "Identificador de la configuració del producte"
          },
          "fishing_pattern": {
            "type": "string",
            "nullable": true,
            "description": "Nom del fishing pattern"
          },
          "fishing_pattern_field": {
            "type": "string",
            "enum": [
              "full_name",
              "description",
              "ou",
              "current_subnet"
            ],
            "nullable": true,
            "description": "Camp sobre el qual s'aplica fishing_pattern. Valors possibles: full_name, description, ou, current_subnet."
          },
          "patch_policy_target_id": {
            "type": "string",
            "nullable": true,
            "description": "Identificador del destí de política de pegats"
          },
          "policy_reporting_group": {
            "type": "string",
            "nullable": true,
            "description": "Identificador del grup de reporte de política"
          },
          "overridden_agent_settings": {
            "$ref": "#/components/schemas/ReportingGroupAgentSettingsV2",
            "nullable": true,
            "description": "Ajustaments de l'agent sobrescrits a nivell de grup de reporte"
          },
          "effective_agent_settings": {
            "$ref": "#/components/schemas/ReportingGroupEffectiveAgentSettingsV2",
            "nullable": true,
            "description": "Ajustaments efectius de l'agent (combinats des de la configuració del producte i sobrescritures)"
          },
          "execute_flexx_analyzer_agent": {
            "type": "boolean",
            "description": "Si l'execució de l'agent Flexx Analyzer està habilitada"
          },
          "intermediate_device_1_id": {
            "type": "string",
            "nullable": true,
            "description": "ID de Workspace del primer dispositiu intermedi (buscat per sysId)"
          },
          "intermediate_device_2_id": {
            "type": "string",
            "nullable": true,
            "description": "ID de Workspace del segon dispositiu intermedi (buscat per sysId)"
          },
          "intermediate_device_3_id": {
            "type": "string",
            "nullable": true,
            "description": "ID de Workspace del tercer dispositiu intermedi (buscat per sysId)"
          }
        },
        "required": [
          "id",
          "name",
          "execute_flexx_analyzer_agent"
        ]
      },
      "ReportingGroupAgentSettingsV2": {
        "type": "object",
        "properties": {
          "remote_support": {
            "type": "string",
            "nullable": true,
            "description": "Configuració de suport remot"
          },
          "collect_device_location": {
            "type": "boolean",
            "nullable": true,
            "description": "Si la recopilació d'ubicació del dispositiu està habilitada"
          },
          "auto_update_agents": {
            "type": "boolean",
            "nullable": true,
            "description": "Si l'actualització automàtica d'agents està habilitada"
          },
          "collect_event_logs": {
            "type": "boolean",
            "nullable": true,
            "description": "Si la recopilació de registres d'esdeveniments està habilitada"
          },
          "event_log_ids": {
            "type": "string",
            "nullable": true,
            "description": "IDs de registres d'esdeveniments"
          },
          "event_logs_recurrence": {
            "type": "number",
            "nullable": true,
            "description": "Recurrència de registres d'esdeveniments"
          },
          "collect_disks": {
            "type": "boolean",
            "nullable": true,
            "description": "Si la recopilació de discos està habilitada"
          },
          "collect_services": {
            "type": "boolean",
            "nullable": true,
            "description": "Si la recopilació de serveis està habilitada"
          },
          "collect_pnp_events": {
            "type": "boolean",
            "nullable": true,
            "description": "Si la recopilació d'esdeveniments PnP està habilitada"
          },
          "collect_public_ip": {
            "type": "boolean",
            "nullable": true,
            "description": "Si la recopilació d'IP pública està habilitada"
          },
          "fra_system_actions_role": {
            "type": "string",
            "nullable": true,
            "description": "Rol d'accions del sistema FRA"
          },
          "unified_reporting": {
            "type": "string",
            "nullable": true,
            "description": "Configuració de reporte unificat"
          },
          "unified_operations": {
            "type": "string",
            "nullable": true,
            "description": "Configuració d'operacions unificades"
          },
          "uninstall_protection": {
            "type": "string",
            "nullable": true,
            "enum": [
              "off",
              "on"
            ],
            "description": "Valors possibles: off, on. Si no hi ha cap estat aplicable, retorna null."
          },
          "web_apps": {
            "type": "boolean",
            "nullable": true,
            "description": "Si les aplicacions web estan habilitades"
          }
        }
      },
      "ReportingGroupEffectiveAgentSettingsV2": {
        "type": "object",
        "description": "Ajustaments efectius de l'agent (inclou camps de configuració del producte més sobrescritures)",
        "properties": {
          "remote_support": {
            "type": "string",
            "nullable": true
          },
          "collect_device_location": {
            "type": "boolean",
            "nullable": true
          },
          "auto_update_agents": {
            "type": "boolean",
            "nullable": true
          },
          "collect_event_logs": {
            "type": "boolean",
            "nullable": true
          },
          "event_log_ids": {
            "type": "string",
            "nullable": true
          },
          "event_logs_recurrence": {
            "type": "number",
            "nullable": true
          },
          "collect_disks": {
            "type": "boolean",
            "nullable": true
          },
          "collect_services": {
            "type": "boolean",
            "nullable": true
          },
          "collect_pnp_events": {
            "type": "boolean",
            "nullable": true
          },
          "collect_public_ip": {
            "type": "boolean",
            "nullable": true
          },
          "fra_system_actions_role": {
            "type": "string",
            "nullable": true
          },
          "unified_reporting": {
            "type": "string",
            "nullable": true
          },
          "uninstall_protection": {
            "type": "string",
            "nullable": true,
            "enum": [
              "off",
              "on"
            ],
            "description": "Valors possibles: off, on. Si no hi ha cap estat aplicable, retorna null."
          },
          "resources_report_recurrence": {
            "type": "number",
            "nullable": true
          },
          "profile_storage_report_recurrence": {
            "type": "number",
            "nullable": true
          },
          "sync_broker_recurrence": {
            "type": "number",
            "nullable": true
          },
          "detect_new_citrix_subscriptions": {
            "type": "boolean",
            "nullable": true
          },
          "proxy_type": {
            "type": "string",
            "nullable": true
          },
          "can_enable_flexx_agent_per_group": {
            "type": "boolean",
            "nullable": true
          },
          "web_apps": {
            "type": "boolean",
            "nullable": true
          },
          "fra_simplified_security": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "CreateRoleRequestV2": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Nom del rol d'usuari."
          },
          "permissions": {
            "type": "array",
            "minItems": 1,
            "description": "Entrades de permisos assignades al rol.",
            "items": {
              "$ref": "#/components/schemas/CreateRolePermissionRequestItemV2"
            }
          }
        },
        "required": [
          "name",
          "permissions"
        ]
      },
      "CreateRolePermissionRequestItemV2": {
        "type": "object",
        "properties": {
          "portal_permission": {
            "type": "string",
            "enum": [
              "admin",
              "organization_admin",
              "organization_admin_read_only",
              "user",
              "platform",
              "l1_support_team",
              "l1_support_team_read_only",
              "l2_support_team",
              "l2_support_team_read_only",
              "l3_engineering_team",
              "l3_engineering_team_read_only",
              "billing"
            ],
            "description": "Nivell de permís de Portal."
          },
          "workspaces_permission": {
            "type": "string",
            "enum": [
              "no_access",
              "l1_support_team_read_only",
              "l1_support_team",
              "l2_support_team_read_only",
              "l2_support_team",
              "l3_engineering_team_read_only",
              "l3_engineering_team",
              "admin_read_only",
              "admin"
            ],
            "description": "Nivell de permís de Workspace."
          },
          "analyzer_permission": {
            "type": "string",
            "enum": [
              "no_access",
              "access",
              "admin"
            ],
            "description": "Nivell de permís d'Analyzer."
          },
          "target_organization": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "all"
                ]
              },
              {
                "type": "string",
                "pattern": "^[0-9a-f]{24}$",
                "minLength": 24,
                "maxLength": 24
              }
            ],
            "description": "Àmbit d'organització del permís: 'all' per a totes les organitzacions o un 'organization_id' específic."
          },
          "target_reporting_groups": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "all"
                ]
              },
              {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{24}$",
                  "minLength": 24,
                  "maxLength": 24
                }
              }
            ],
            "description": "Àmbit de grups de report del permís: 'all' per a tots els grups o llista de 'reporting_group_id' específics."
          }
        },
        "required": [
          "portal_permission",
          "workspaces_permission",
          "analyzer_permission",
          "target_organization",
          "target_reporting_groups"
        ]
      },
      "RoleV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del rol."
          },
          "name": {
            "type": "string",
            "description": "Nom del rol."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització associada a aquest rol."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Marca de temps de creació del rol en format ISO 8601."
          },
          "created_by": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'usuari que va crear el rol."
          },
          "permissions": {
            "type": "array",
            "nullable": true,
            "description": "Entrades de permisos configurades per a aquest rol.",
            "items": {
              "$ref": "#/components/schemas/GetRolePermissionItemV2"
            }
          }
        },
        "required": [
          "id",
          "name",
          "organization_id",
          "created_at",
          "created_by"
        ]
      },
      "GetRolePermissionItemV2": {
        "type": "object",
        "properties": {
          "portal_permission": {
            "type": "string",
            "nullable": true,
            "enum": [
              "admin",
              "organization_admin",
              "organization_admin_read_only",
              "user",
              "platform",
              "l1_support_team",
              "l1_support_team_read_only",
              "l2_support_team",
              "l2_support_team_read_only",
              "l3_engineering_team",
              "l3_engineering_team_read_only",
              "billing"
            ],
            "description": "Nivell de permís de Portal."
          },
          "workspaces_permission": {
            "type": "string",
            "nullable": true,
            "enum": [
              "no_access",
              "l1_support_team_read_only",
              "l1_support_team",
              "l2_support_team_read_only",
              "l2_support_team",
              "l3_engineering_team_read_only",
              "l3_engineering_team",
              "admin_read_only",
              "admin"
            ],
            "description": "Nivell de permís de Workspace."
          },
          "analyzer_permission": {
            "type": "string",
            "nullable": true,
            "enum": [
              "no_access",
              "access",
              "admin"
            ],
            "description": "Nivell de permís d'Analyzer."
          },
          "target_organization": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "all"
                ]
              },
              {
                "type": "string",
                "pattern": "^[0-9a-f]{24}$",
                "minLength": 24,
                "maxLength": 24
              }
            ],
            "description": "Àmbit d'organització del permís: 'all' per a totes les organitzacions o un 'organization_id' específic."
          },
          "target_reporting_groups": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "all"
                ]
              },
              {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{24}$",
                  "minLength": 24,
                  "maxLength": 24
                }
              }
            ],
            "description": "Àmbit de grups de report del permís: 'all' per a tots els grups o llista de 'reporting_group_id' específics."
          }
        },
        "required": [
          "target_organization",
          "target_reporting_groups"
        ]
      },
      "CreateTenantRequestV2": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "tenant",
              "organization"
            ],
            "description": "Tipus de creació. `tenant` per END CUSTOMER, `organization` per PARTNER/WHOLESALER."
          },
          "name": {
            "type": "string",
            "maxLength": 512
          },
          "tenant_config": {
            "type": "object",
            "additionalProperties": false,
            "nullable": true,
            "description": "Configuració específica per `type=tenant`.",
            "properties": {
              "product_config_id": {
                "type": "string",
                "maxLength": 24,
                "pattern": "^[0-9a-f]{24}$"
              },
              "analyzer": {
                "type": "string",
                "enum": [
                  "existing",
                  "new"
                ]
              }
            },
            "required": [
              "product_config_id",
              "analyzer"
            ]
          },
          "organization_config": {
            "type": "object",
            "additionalProperties": false,
            "nullable": true,
            "description": "Configuració específica per `type=organization`.",
            "properties": {
              "product_id": {
                "type": "string",
                "maxLength": 24,
                "pattern": "^[0-9a-f]{24}$"
              },
              "region": {
                "type": "string",
                "maxLength": 128
              }
            },
            "required": [
              "product_id",
              "region"
            ]
          },
          "policy_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$"
          },
          "organization_email": {
            "type": "string",
            "maxLength": 512
          },
          "organization_language": {
            "type": "string",
            "maxLength": 512
          },
          "organization_country": {
            "type": "string",
            "maxLength": 512
          },
          "organization_industry": {
            "type": "string",
            "maxLength": 512
          }
        },
        "required": [
          "type",
          "name",
          "organization_email",
          "organization_language",
          "organization_country",
          "organization_industry"
        ],
        "description": "Cos únic de creació amb camps condicionals per `type`: si `type=tenant`, requereix `tenant_config`; si `type=organization`, requereix `organization_config`."
      },
      "TenantByIdV2": {
        "type": "object",
        "required": [
          "id",
          "organization_id",
          "created_at",
          "name",
          "region"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "organization_id": {
            "type": "string",
            "description": "ID de l'organització del tenant"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "product_id": {
            "type": "string",
            "nullable": true,
            "description": "ID del producte"
          },
          "policy_id": {
            "type": "string",
            "nullable": true,
            "description": "ID de la política"
          }
        }
      },
      "CreateUserRequestV2": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Nom de l'usuari."
          },
          "surname": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Cognom de l'usuari."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Adreça de correu electrònic de l'usuari."
          },
          "language": {
            "type": "string",
            "enum": [
              "en-EN",
              "es-ES",
              "pt-BR",
              "ca-ES",
              "eu-ES"
            ],
            "description": "Codi de llengua preferit."
          },
          "role_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del rol assignat a l'usuari."
          },
          "department": {
            "type": "string",
            "nullable": true,
            "description": "Departament de l'usuari."
          },
          "email_login_enabled": {
            "type": "boolean",
            "nullable": true,
            "description": "Si l'inici de sessió per correu electrònic està habilitat per a l'usuari."
          }
        },
        "required": [
          "name",
          "surname",
          "email",
          "language",
          "role_id"
        ]
      },
      "UserByIdV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'usuari."
          },
          "organization_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització associada a l'usuari."
          },
          "name": {
            "type": "string",
            "description": "Nom de l'usuari."
          },
          "surname": {
            "type": "string",
            "description": "Cognom de l'usuari."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Adreça de correu electrònic de l'usuari."
          },
          "language": {
            "type": "string",
            "enum": [
              "en-EN",
              "es-ES",
              "pt-BR",
              "ca-ES",
              "eu-ES"
            ],
            "description": "Codi de llengua preferit per a l'usuari."
          },
          "created_at": {
            "type": "string",
            "description": "Data de creació en format ISO 8601."
          },
          "department": {
            "type": "string",
            "nullable": true,
            "description": "Departament de l'usuari."
          },
          "role_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del rol assignat a l'usuari."
          },
          "created_by": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'usuari que va crear el registre de l'usuari."
          },
          "email_login_enabled": {
            "type": "boolean",
            "nullable": true,
            "description": "Indica si l'inici de sessió per correu electrònic està habilitat per a l'usuari."
          }
        },
        "required": [
          "id",
          "name",
          "surname",
          "email",
          "language",
          "created_at"
        ]
      },
      "CreateWorkspaceGroupScheduleRequestV2": {
        "type": "object",
        "properties": {
          "cron_expression": {
            "type": "string",
            "description": "Expressió cron que defineix quan s'ha d'executar la programació. Format: minut hora dia-del-mes mes dia-de-la-setmana. Exemples: '0 8 * * 1-5' (8 AM en dies laborables), '0 0 * * 0' (mitjanit del diumenge), '30 14 * * *' (2:30 PM diàriament). Dia-de-la-setmana: 0=diumenge, 1=dilluns, ..., 6=dissabte. Admet rangs (1-5), llistes (1,3,5) i comodins (*). Ha de ser un format d'expressió cron vàlid amb 5 camps separats per espais.",
            "example": "0 8 * * 1-5"
          },
          "time_zone": {
            "type": "string",
            "description": "Zona horària per a l'execució de la programació. Admet identificadors IANA (per exemple, 'America/New_York') i Windows (per exemple, 'Pacific Standard Time').",
            "example": "Eastern Standard Time"
          },
          "type": {
            "type": "string",
            "enum": [
              "start",
              "stop",
              "restart"
            ],
            "description": "Tipus d'operació d'energia a realitzar. START: Encén els Workspaces del grup. STOP: Apaga els Workspaces del grup. RESTART: Reinicia els Workspaces del grup.",
            "example": "start"
          },
          "intermediate_device": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Opcional. L'identificador únic del Workspace de dispositiu intermedi. Si es proporciona, indica que s'ha d'utilitzar un dispositiu intermedi per operacions Wake on LAN. Només aplicable a programacions START. S'utilitza per a accions Wake on LAN en xarxes segures. El Workspace ha d'existir i pertànyer a l'organització.",
            "example": "507f1f77bcf86cd799439050"
          }
        },
        "required": [
          "cron_expression",
          "time_zone",
          "type"
        ]
      },
      "WorkspaceGroupScheduleV2": {
        "type": "object",
        "required": [
          "id",
          "cron_expression",
          "time_zone",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "description": "L'identificador únic de la programació",
            "example": "507f1f77bcf86cd799439060"
          },
          "cron_expression": {
            "type": "string",
            "description": "Expressió cron que defineix quan es executa la programació. Format: minut hora dia-del-mes mes dia-de-la-setmana.",
            "example": "0 8 * * 1-5"
          },
          "time_zone": {
            "type": "string",
            "description": "Zona horària per a l'execució de la programació. Admet identificadors IANA (per exemple, 'America/New_York') i Windows (per exemple, 'Pacific Standard Time').",
            "example": "Eastern Standard Time"
          },
          "type": {
            "type": "string",
            "enum": [
              "start",
              "stop",
              "restart"
            ],
            "description": "Tipus d'operació d'energia: START (encén), STOP (apaga), RESTART (reinicia Workspaces)"
          },
          "intermediate_device": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "nullable": true,
            "description": "L'identificador únic del Workspace del dispositiu intermedi, si està configurat. S'utilitza per a accions de Wake on LAN en xarxes segures.",
            "example": "507f1f77bcf86cd799439050"
          },
          "created_by": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "nullable": true,
            "description": "ID d'usuari que va crear la programació",
            "example": "507f1f77bcf86cd799439070"
          }
        }
      },
      "WorkspacegroupsCreateRequestV2": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 512
          },
          "description": {
            "type": "string",
            "maxLength": 512
          },
          "type": {
            "type": "string",
            "enum": [
              "static"
            ],
            "default": "static"
          },
          "location": {
            "$ref": "#/components/schemas/WorkspaceGroupBaseUpdateLocationInputV2"
          }
        },
        "required": [
          "name"
        ]
      },
      "WorkspaceGroupBaseUpdateLocationInputV2": {
        "type": "object",
        "properties": {
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "address": {
            "type": "string",
            "maxLength": 512
          },
          "description": {
            "type": "string",
            "maxLength": 512
          }
        },
        "required": [
          "latitude",
          "longitude",
          "address"
        ]
      },
      "WorkspaceGroupDetailResponseV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "description": "ID del grup de workspaces"
          },
          "name": {
            "type": "string",
            "description": "Nom del grup de workspaces"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Descripció del grup de workspaces"
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "description": "Identificador d'organització"
          },
          "created_by": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "description": "ID de l'usuari que va crear el grup de workspaces"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Marca de temps de creació"
          },
          "type": {
            "type": "string",
            "nullable": true,
            "enum": [
              "static",
              "dynamic",
              "entra_id"
            ],
            "description": "Tipus de grup de workspaces"
          },
          "filter": {
            "type": "string",
            "nullable": true,
            "description": "Cadena de filtratge per als grups de workspaces dinàmics"
          },
          "location": {
            "$ref": "#/components/schemas/WorkspaceLocationV2",
            "nullable": true,
            "description": "Informació de ubicació del grup de workspaces"
          },
          "entra_id_source": {
            "$ref": "#/components/schemas/WorkspaceGroupEntraIdSourceV2",
            "nullable": true,
            "description": "Informació d'origen de Entra ID per al grup de workspaces"
          }
        },
        "required": [
          "id",
          "name",
          "organization_id",
          "created_at"
        ]
      },
      "WorkspaceGroupEntraIdSourceV2": {
        "type": "object",
        "properties": {
          "resource_id": {
            "type": "string",
            "description": "ID de recurs de Entra ID"
          },
          "resource_type": {
            "type": "string",
            "enum": [
              "group",
              "administrative_unit"
            ],
            "description": "Tipus de recurs de Entra ID"
          },
          "resource_name": {
            "type": "string",
            "description": "Nom del recurs de Entra ID"
          }
        },
        "required": [
          "resource_id",
          "resource_type",
          "resource_name"
        ]
      },
      "WorkspaceLocationV2": {
        "type": "object",
        "properties": {
          "latitude": {
            "type": "number",
            "description": "Coordenada de latitud"
          },
          "longitude": {
            "type": "number",
            "description": "Coordenada de longitud"
          },
          "address": {
            "type": "string",
            "description": "Cadena d'adreça"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Descripció de la ubicació"
          }
        },
        "required": [
          "latitude",
          "longitude",
          "address"
        ]
      },
      "GetOperationByIdResponseV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'execució de l'operació."
          },
          "name": {
            "type": "string",
            "description": "Nom de l'operació."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització propietària de l'operació."
          },
          "description": {
            "type": "string",
            "description": "Descripció de l'operació. Es retorna cadena buida quan no existeix en origen."
          },
          "status": {
            "type": "string",
            "enum": [
              "finished",
              "unknown",
              "error",
              "pending",
              "in-progress",
              "timeout",
              "cancelled",
              "scheduled"
            ],
            "description": "Estat actual de l'operació."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Marca temporal de creació."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Marca temporal d'inici."
          },
          "ended_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Marca temporal de finalització."
          },
          "microservice_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del microservei relacionat, quan existeixi."
          },
          "flow_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del flux relacionat, quan existeixi."
          },
          "remote_support": {
            "$ref": "#/components/schemas/GetOperationByIdRemoteSupportV2"
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "description",
          "status",
          "created_at"
        ]
      },
      "GetOperationByIdRemoteSupportV2": {
        "type": "object",
        "nullable": true,
        "properties": {
          "start_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data d'inici del suport remot."
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data de finalització del suport remot."
          },
          "type": {
            "type": "string",
            "nullable": true,
            "description": "Tipus de sessió de suport remot."
          }
        }
      },
      "GetAuditsResponseV2": {
        "type": "object",
        "required": [
          "has_next",
          "data"
        ],
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si existeix una pàgina següent."
          },
          "data": {
            "type": "array",
            "description": "Llistat d'auditories.",
            "items": {
              "$ref": "#/components/schemas/AuditItemV2"
            }
          }
        }
      },
      "AuditItemV2": {
        "type": "object",
        "required": [
          "id",
          "audited_at",
          "action",
          "entity_type",
          "entity_id",
          "trigger_type",
          "trigger_id",
          "trigger_name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Identificador de l'auditoria.",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24
          },
          "audited_at": {
            "type": "string",
            "format": "date-time",
            "description": "Data en la qual es registra l'auditoria."
          },
          "organization_id": {
            "type": "string",
            "nullable": true,
            "description": "Identificador de l'organització associada al registre.",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24
          },
          "action": {
            "type": "string",
            "description": "Acció auditada.",
            "enum": [
              "insert",
              "update",
              "delete",
              "recover",
              "soft_delete"
            ]
          },
          "entity_type": {
            "type": "string",
            "description": "Tipus d'entitat sobre la qual s'executa l'acció."
          },
          "entity_id": {
            "type": "string",
            "description": "Identificador de l'entitat afectada."
          },
          "trigger_type": {
            "type": "string",
            "description": "Tipus d'actor que desencadena l'acció.",
            "enum": [
              "api",
              "user"
            ]
          },
          "trigger_id": {
            "type": "string",
            "description": "Identificador de l'actor.",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24
          },
          "trigger_name": {
            "type": "string",
            "description": "Nom visible de l'actor."
          }
        }
      },
      "ConditionTypeV2ListResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha més resultats disponibles a la següent pàgina"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConditionTypeV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "ConditionTypeV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "frequency_values": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "value_type": {
            "type": "string"
          },
          "value_placeholder": {
            "type": "string",
            "nullable": true
          },
          "period": {
            "type": "boolean"
          },
          "op_values": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "eq",
                "gt",
                "lt",
                "gte",
                "lte",
                "startsWith",
                "endsWith",
                "contains",
                "at"
              ]
            },
            "description": "Valors d'operador permesos per al value_type d'aquest tipus de condició. Camp calculat basat en value_type: string → [\"eq\", \"startsWith\", \"endsWith\", \"contains\"], int/double → [\"eq\", \"gt\", \"lt\", \"gte\", \"lte\"], id/bool → [\"eq\"], cron → [\"at\"]"
          }
        },
        "required": [
          "id"
        ]
      },
      "ListDigitalActivityCoreProcessGroupCoreProcessesResponseV2": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetDigitalActivityCoreProcessResponseV2"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "GetDigitalActivityCoreProcessResponseV2": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nom funcional del procés core."
          },
          "process_name": {
            "type": "string",
            "description": "Nom del procés del sistema operatiu."
          }
        },
        "required": [
          "name",
          "process_name"
        ]
      },
      "ListDigitalActivityCoreProcessGroupsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si existeix una pàgina següent."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetDigitalActivityCoreProcessGroupResponseV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "ListDigitalActivityCoreProcessMetricsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si existeix una pàgina següent."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetDigitalActivityCoreProcessMetricsResponseV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetDigitalActivityCoreProcessMetricsResponseV2": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del workspace"
          },
          "core_process_group_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del grup de processos core."
          },
          "reporting_group_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del grup de reporting associat."
          },
          "organization_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització associada al registre."
          },
          "core_activity_time_hours": {
            "type": "number",
            "description": "Hores d'activitat core."
          },
          "reporting_time_hours": {
            "type": "number",
            "description": "Hores de temps reportat."
          },
          "opened_session_time_hours": {
            "type": "number",
            "description": "Hores de sessió oberta."
          },
          "user_active_time_hours": {
            "type": "number",
            "description": "Hores d'activitat d'usuari."
          },
          "month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "description": "Mes de la mètrica."
          },
          "year": {
            "type": "integer",
            "minimum": 2000,
            "maximum": 2100,
            "description": "Any de la mètrica."
          },
          "deleted_date": {
            "type": "string",
            "nullable": true,
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "Data d'eliminació del workspace quan s'aplica."
          }
        }
      },
      "ListDigitalActivityHybridWorkMetricsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si existeix una pàgina següent."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetDigitalActivityHybridWorkMetricsResponseV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetDigitalActivityHybridWorkMetricsResponseV2": {
        "type": "object",
        "properties": {
          "user_name": {
            "type": "string",
            "description": "Identificador llegible de l'usuari en la mètrica."
          },
          "office_active_time_hours": {
            "type": "number",
            "description": "Hores d'activitat a l'oficina."
          },
          "remote_active_time_hours": {
            "type": "number",
            "description": "Hores d'activitat remota."
          },
          "ambiguous_active_time_hours": {
            "type": "number",
            "description": "Hores d'activitat sense classificació d'entorn."
          },
          "total_active_time_hours": {
            "type": "number",
            "description": "Hores totals d'activitat."
          },
          "month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "description": "Mes de la mètrica."
          },
          "year": {
            "type": "integer",
            "minimum": 2000,
            "maximum": 2100,
            "description": "Any de la mètrica."
          },
          "organization_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització associada a la fila."
          }
        }
      },
      "ListDigitalActivityUserMetricsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si existeix una pàgina següent."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetDigitalActivityUserMetricsResponseV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetDigitalActivityUserMetricsResponseV2": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del workspace"
          },
          "user_name": {
            "type": "string",
            "description": "Identificador llegible de l'usuari en la mètrica."
          },
          "reporting_group_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del grup de reporting associat."
          },
          "reporting_time_hours": {
            "type": "number",
            "description": "Hores de temps reportat."
          },
          "opened_session_time_hours": {
            "type": "number",
            "description": "Hores de sessió oberta."
          },
          "user_active_time_hours": {
            "type": "number",
            "description": "Hores d'activitat de l'usuari."
          },
          "month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "description": "Mes de la mètrica."
          },
          "year": {
            "type": "integer",
            "minimum": 2000,
            "maximum": 2100,
            "description": "Any de la mètrica."
          },
          "deleted_date": {
            "type": "string",
            "nullable": true,
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "Data d'eliminació del workspace quan s'aplica."
          },
          "organization_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització associada a la fila."
          }
        }
      },
      "ListDigitalActivityWorkspaceMetricsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si existeix una pàgina següent."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetDigitalActivityWorkspaceMetricsResponseV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetDigitalActivityWorkspaceMetricsResponseV2": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del workspace"
          },
          "reporting_group_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del grup de reporting associat."
          },
          "reporting_time_hours": {
            "type": "number",
            "description": "Hores de temps reportat."
          },
          "opened_session_time_hours": {
            "type": "number",
            "description": "Hores de sessió oberta."
          },
          "user_active_time_hours": {
            "type": "number",
            "description": "Hores d'activitat de l'usuari."
          },
          "core_activity_time_hours": {
            "type": "number",
            "nullable": true,
            "description": "Hores d'activitat core."
          },
          "month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "description": "Mes de la mètrica."
          },
          "year": {
            "type": "integer",
            "minimum": 2000,
            "maximum": 2100,
            "description": "Any de la mètrica."
          },
          "deleted_date": {
            "type": "string",
            "nullable": true,
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "Data d'eliminació del workspace quan s'aplica."
          }
        }
      },
      "FlowListItemV2ListResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowListItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "FlowListItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "session",
              "workspace"
            ]
          },
          "detection_only": {
            "type": "boolean"
          },
          "cooldown_minutes": {
            "type": "number",
            "description": "Temps d'espera en minuts"
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "id"
        ]
      },
      "GetInstalledAppByIdResponseV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'aplicació instal·lada."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització associada amb l'aplicació instal·lada."
          },
          "name": {
            "type": "string",
            "description": "Nom de l'aplicació instal·lada."
          },
          "publisher": {
            "type": "string",
            "nullable": true,
            "description": "Proveïdor de l'aplicació instal·lada."
          },
          "operating_system": {
            "type": "string",
            "enum": [
              "windows",
              "linux",
              "android",
              "mac_os",
              "chrome_os",
              "other"
            ],
            "description": "Sistema operatiu on es observa l'aplicació."
          },
          "notes": {
            "type": "string",
            "description": "Notes associades amb l'aplicació instal·lada."
          },
          "discovered_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Marca de temps del primer descobriment."
          },
          "reported_at": {
            "type": "string",
            "format": "date-time",
            "description": "Marca de temps de l'últim report."
          },
          "installations": {
            "type": "integer",
            "minimum": 0,
            "description": "Nombre d'instal·lacions observades per a l'aplicació."
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "operating_system",
          "notes",
          "reported_at",
          "installations"
        ]
      },
      "GetInstalledAppVersionsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetInstalledAppVersionsItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetInstalledAppVersionsItemV2": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "nullable": true,
            "description": "Versió de l'aplicació instal·lada."
          },
          "reported_at": {
            "type": "string",
            "format": "date-time",
            "description": "Marca de temps del darrer report per a aquesta versió."
          },
          "discovered_at": {
            "type": "string",
            "format": "date-time",
            "description": "Marca de temps de la primera observació per a aquesta versió."
          }
        },
        "required": [
          "reported_at",
          "discovered_at"
        ]
      },
      "GetInstalledAppWorkspacesResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetInstalledAppWorkspacesItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetInstalledAppWorkspacesItemV2": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de Workspace."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de la organització."
          },
          "version": {
            "type": "string",
            "nullable": true,
            "description": "Versió de l'aplicació instal·lada reportada per al Workspace."
          },
          "reported_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data i hora del darrer report d'instal·lació per al Workspace."
          },
          "install_location": {
            "type": "string",
            "nullable": true,
            "description": "Ruta d'instal·lació reportada per a l'aplicació en el Workspace."
          },
          "installed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data i hora d'instal·lació reportada per al Workspace."
          }
        },
        "required": [
          "workspace_id",
          "organization_id"
        ]
      },
      "GetInstalledAppsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetInstalledAppsItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetInstalledAppsItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'aplicació instal·lada."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització associat a aquest element d'aplicació instal·lada."
          },
          "name": {
            "type": "string",
            "description": "Nom de l'aplicació instal·lada."
          },
          "discovered_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Marca de temps del primer descobriment."
          },
          "reported_at": {
            "type": "string",
            "format": "date-time",
            "description": "Marca de temps de l'últim report."
          },
          "operating_system": {
            "type": "string",
            "enum": [
              "windows",
              "linux",
              "android",
              "mac_os",
              "chrome_os",
              "other"
            ],
            "description": "Sistema operatiu on es observa l'aplicació."
          },
          "publisher": {
            "type": "string",
            "nullable": true,
            "description": "Publicador de l'aplicació."
          },
          "installations": {
            "type": "integer",
            "minimum": 0,
            "description": "Nombre d'instal·lacions observades per a l'aplicació."
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "reported_at",
          "operating_system",
          "installations"
        ]
      },
      "GetMeResponseV2": {
        "type": "object",
        "properties": {
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de la organització autenticada."
          },
          "token_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'API key autenticada."
          },
          "token_name": {
            "type": "string",
            "nullable": true,
            "description": "Nom del token autenticat."
          },
          "token_created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Data de creació del token."
          },
          "token_expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Data de caducitat del token."
          }
        },
        "required": [
          "organization_id",
          "token_id",
          "token_name",
          "token_created_at",
          "token_expires_at"
        ]
      },
      "GetMicroserviceByIdResponseV2": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/MicroserviceItemV2"
          }
        },
        "required": [
          "data"
        ]
      },
      "MicroserviceItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del microservei."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització associada al microservei."
          },
          "name": {
            "type": "string",
            "description": "Nom del microservei resolt en l'idioma sol·licitat."
          },
          "description": {
            "type": "string",
            "description": "Descripció del microservei resolta en l'idioma sol·licitat."
          },
          "category": {
            "type": "string",
            "description": "Categoria del microservei resolta en l'idioma sol·licitat."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Data i hora de creació del microservei."
          },
          "archived_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data i hora de l'arxiu, quan sigui aplicable."
          },
          "type": {
            "type": "string",
            "enum": [
              "standard",
              "condition"
            ],
            "nullable": true,
            "description": "Tipus funcional del microservei."
          },
          "context": {
            "type": "string",
            "nullable": true,
            "description": "Context de visibilitat del microservei."
          },
          "is_ai_enhanced": {
            "type": "boolean",
            "nullable": true,
            "description": "Indica si el microservei té capacitats de IA habilitades."
          },
          "enabled": {
            "type": "boolean",
            "description": "Indica si el microservei està habilitat per a l'organització."
          },
          "enabled_configuration": {
            "type": "object",
            "nullable": true,
            "description": "Configuració habilitada del microservei per a l'organització.",
            "properties": {
              "enabled_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "description": "Data i hora en què es va habilitar la configuració."
              },
              "efficiency": {
                "type": "number",
                "description": "Valor d'eficiència de la configuració habilitada."
              },
              "workspace_group_execution": {
                "type": "string",
                "enum": [
                  "l1",
                  "l2",
                  "l3"
                ],
                "description": "Mode d'execució per grups de workspace."
              },
              "individual_execution": {
                "type": "string",
                "enum": [
                  "l1",
                  "l2",
                  "l3"
                ],
                "description": "Mode d'execució individual."
              },
              "end_user_execution_workspace_group_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{24}$",
                  "minLength": 24,
                  "maxLength": 24
                },
                "description": "Identificadors de grups de workspace habilitats per a execució d'usuari final."
              }
            },
            "required": [
              "enabled_at",
              "efficiency",
              "workspace_group_execution",
              "individual_execution",
              "end_user_execution_workspace_group_ids"
            ]
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "description",
          "category",
          "created_at",
          "archived_at",
          "type",
          "context",
          "is_ai_enhanced",
          "enabled",
          "enabled_configuration"
        ]
      },
      "GetMicroservicesResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si existeix una pàgina següent."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MicroserviceItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetOperationResultsResponseV2": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetOperationResultItemV2"
            }
          },
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha més resultats a la pàgina següent."
          }
        },
        "required": [
          "data",
          "has_next"
        ]
      },
      "GetOperationResultItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del resultat."
          },
          "operation_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'operació associada."
          },
          "workspace_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'espai de treball associat."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització associada."
          },
          "status": {
            "type": "string",
            "description": "Estat d'execució del resultat.",
            "enum": [
              "scheduled",
              "pending",
              "in-progress",
              "completed",
              "error",
              "timeout",
              "cancelled",
              "unknown"
            ]
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Nom de màquina associat a la sessió quan existeixi."
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data i hora d'inici de l'execució."
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data i hora de finalització de l'execució."
          },
          "script_detail": {
            "type": "string",
            "nullable": true,
            "description": "Detall d'execució del script quan existeixi."
          },
          "script_duration": {
            "type": "number",
            "nullable": true,
            "description": "Durada del script en segons quan existeixi."
          },
          "script_response": {
            "type": "array",
            "nullable": true,
            "description": "Sortida estructurada del script amb timestamp i línia.",
            "items": {
              "$ref": "#/components/schemas/GetOperationResultScriptResponseLineV2"
            }
          }
        },
        "required": [
          "id",
          "operation_id",
          "workspace_id",
          "status"
        ]
      },
      "GetOperationResultScriptResponseLineV2": {
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Timestamp ISO-8601 de la línia o null quan no estigui disponible."
          },
          "line": {
            "type": "string",
            "description": "Contingut de la línia o bloc de sortida."
          }
        },
        "required": [
          "timestamp",
          "line"
        ]
      },
      "GetOperationsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si existeix una pàgina següent."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetOperationItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetOperationItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'execució de l'operació."
          },
          "name": {
            "type": "string",
            "description": "Nom de l'operació."
          },
          "description": {
            "type": "string",
            "description": "Descripció de l'operació. Es retorna cadena buida quan no existeix en origen."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització propietària de l'operació."
          },
          "status": {
            "type": "string",
            "enum": [
              "finished",
              "unknown",
              "error",
              "pending",
              "in-progress",
              "timeout",
              "cancelled",
              "scheduled"
            ],
            "description": "Estat actual de l'operació."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Marca temporal de creació."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Marca temporal d'inici."
          },
          "ended_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Marca temporal de finalització."
          },
          "microservice_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del microservei relacionat, quan existeixi."
          },
          "flow_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del flux relacionat, quan existeixi."
          },
          "remote_support": {
            "$ref": "#/components/schemas/GetOperationRemoteSupportV2"
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "description",
          "status",
          "created_at"
        ]
      },
      "GetOperationRemoteSupportV2": {
        "type": "object",
        "nullable": true,
        "properties": {
          "start_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data d'inici del suport remot."
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data de finalització del suport remot."
          },
          "type": {
            "type": "string",
            "nullable": true,
            "description": "Tipus de sessió de suport remot."
          }
        }
      },
      "GetOrganizationEntityLimitsResponseV2": {
        "type": "object",
        "properties": {
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització a la qual s'apliquen els límits."
          },
          "limits": {
            "$ref": "#/components/schemas/OrganizationEntityLimitsV2"
          }
        },
        "required": [
          "organization_id",
          "limits"
        ]
      },
      "OrganizationEntityLimitsV2": {
        "type": "object",
        "properties": {
          "tenants": {
            "type": "integer",
            "minimum": 1
          },
          "reporting_groups": {
            "type": "integer",
            "minimum": 1
          },
          "workspace_groups": {
            "type": "integer",
            "minimum": 1
          },
          "workspace_group_schedules_per_group": {
            "type": "integer",
            "minimum": 1
          },
          "flows": {
            "type": "integer",
            "minimum": 1
          },
          "microservices": {
            "type": "integer",
            "minimum": 1
          },
          "reports": {
            "type": "integer",
            "minimum": 1
          },
          "webapps": {
            "type": "integer",
            "minimum": 1
          },
          "webhooks": {
            "type": "integer",
            "minimum": 1
          },
          "licenses": {
            "type": "integer",
            "minimum": 1
          },
          "alert_settings": {
            "type": "integer",
            "minimum": 1
          },
          "roles": {
            "type": "integer",
            "minimum": 1
          },
          "users": {
            "type": "integer",
            "minimum": 1
          },
          "patching_policies": {
            "type": "integer",
            "minimum": 1
          },
          "patching_targets": {
            "type": "integer",
            "minimum": 1
          },
          "policies": {
            "type": "integer",
            "minimum": 1
          },
          "microservice_categories": {
            "type": "integer",
            "minimum": 1
          },
          "domains": {
            "type": "integer",
            "minimum": 1
          },
          "sso_integrations": {
            "type": "integer",
            "minimum": 1
          },
          "product_configs": {
            "type": "integer",
            "minimum": 1
          },
          "modules": {
            "type": "integer",
            "minimum": 1
          },
          "api_keys": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "tenants",
          "reporting_groups",
          "workspace_groups",
          "workspace_group_schedules_per_group",
          "flows",
          "microservices",
          "reports",
          "webapps",
          "webhooks",
          "licenses",
          "alert_settings",
          "roles",
          "users",
          "patching_policies",
          "patching_targets",
          "policies",
          "microservice_categories",
          "domains",
          "sso_integrations",
          "product_configs",
          "modules",
          "api_keys"
        ]
      },
      "PatchPolicyTargetV2ListResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha més resultats disponibles a la següent pàgina"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatchPolicyTargetV2"
            },
            "description": "Arreglament d'objectes de destí de política de pegats"
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "PatchPolicyTargetV2": {
        "type": "object",
        "description": "Recurs de destí de política de pegats",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "El identificador únic del destí de política de pegats",
            "example": "66ab6cf4d4d2e709bafd404c"
          },
          "name": {
            "type": "string",
            "description": "Nom del destí de política de pegats",
            "example": "Base"
          },
          "created_by": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "ID d'usuari que va crear l'objectiu de política de pedaços",
            "example": "6439606652fc0c0051f1787b"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Data i hora de creació de l'objectiu de política de pedaços (datetime ISO 8601)",
            "example": "2024-08-01T11:09:40.719Z"
          },
          "timezone": {
            "type": "string",
            "description": "Zona horària per a la programació de la política de pegats. Identificador de zona horària IANA o nom de zona horària de Windows.",
            "example": "UTC"
          },
          "should_restart": {
            "type": "boolean",
            "description": "Si s'han de reiniciar els Workspaces després del pegat",
            "example": true
          },
          "wake_on_lan": {
            "type": "boolean",
            "description": "Si s'ha d'utilitzar Wake on LAN per al parche",
            "example": true
          },
          "force_patching_configuration": {
            "type": "boolean",
            "description": "Si s'ha de forçar la configuració de pegat",
            "example": false
          },
          "is_in_maintenance": {
            "type": "boolean",
            "description": "Si el destí de política de pegats està actualment en mode de manteniment",
            "example": false
          },
          "weeks": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 4
            },
            "description": "Arreglament de números de setmana (1-4) en les quals ha d'ocórrer el pegat",
            "example": [
              1,
              2
            ]
          },
          "schedule": {
            "type": "object",
            "description": "Programació que defineix quan ocorre el pegat. Les claus són noms de dies (MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY). Els valors són objectes buits o objectes amb claus d'hora (com cadenes) que contenen arregles de números de minut.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 59
                }
              }
            },
            "example": {
              "MONDAY": {},
              "TUESDAY": {},
              "WEDNESDAY": {},
              "THURSDAY": {
                "9": [
                  15,
                  30,
                  45
                ],
                "10": [
                  0,
                  15,
                  30,
                  45
                ],
                "11": [
                  0,
                  15,
                  30,
                  45
                ]
              },
              "FRIDAY": {},
              "SATURDAY": {},
              "SUNDAY": {}
            }
          },
          "patch_policy_target_type": {
            "type": "string",
            "enum": [
              "windows",
              "linux",
              null
            ],
            "nullable": true,
            "description": "Tipus de destí de política de pegats ('windows', 'linux' o null).",
            "example": "windows"
          },
          "patch_policy_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "nullable": true,
            "description": "El identificador únic de la política de pegats associada. Null si no hi ha una política de pegats assignada.",
            "example": "507f1f77bcf86cd799439011"
          }
        },
        "required": [
          "id"
        ]
      },
      "ProductConfigV2ListResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha més pàgines disponibles"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductConfigV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "ProductConfigV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Identificador únic de la configuració de producte",
            "example": "507f1f77bcf86cd799439011"
          },
          "environment": {
            "type": "string",
            "description": "Tipus d'entorn per a la configuració de producte (p. ex., PRODUCTION, STAGING, DEVELOPMENT)",
            "example": "PRODUCTION"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Data i hora de creació de la configuració de producte (data i hora ISO 8601)",
            "example": "2024-01-15T10:30:00.000Z"
          },
          "active": {
            "type": "boolean",
            "description": "Indica si la configuració de producte està activa.",
            "example": true
          },
          "product_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Identificador únic del producte associat amb aquesta configuració",
            "example": "507f1f77bcf86cd799439001"
          },
          "region": {
            "type": "string",
            "nullable": true,
            "description": "Nom de la regió on es desplega la configuració de producte. Nul si no hi ha regió assignada.",
            "example": "us-east"
          }
        },
        "required": [
          "id"
        ]
      },
      "GetReportingGroupAgentVersionsCatalogResponseV2": {
        "type": "object",
        "properties": {
          "windows_cp": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "windows": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "macos": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "linux": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "windows_cp",
          "windows",
          "macos",
          "linux"
        ]
      },
      "GetReportingGroupAgentVersionsResponseV2": {
        "type": "object",
        "properties": {
          "agent_auto_update": {
            "type": "boolean"
          },
          "versions": {
            "$ref": "#/components/schemas/ReportingGroupAgentVersionsV2"
          }
        },
        "required": [
          "agent_auto_update",
          "versions"
        ]
      },
      "ReportingGroupAgentVersionsV2": {
        "type": "object",
        "properties": {
          "windows_cp": {
            "$ref": "#/components/schemas/ReportingGroupAgentVersionChannelPairV2"
          },
          "windows": {
            "$ref": "#/components/schemas/ReportingGroupAgentVersionChannelPairV2"
          },
          "macos": {
            "$ref": "#/components/schemas/ReportingGroupAgentVersionChannelPairV2"
          },
          "linux": {
            "$ref": "#/components/schemas/ReportingGroupAgentVersionChannelPairV2"
          }
        },
        "required": [
          "windows_cp",
          "windows",
          "macos",
          "linux"
        ]
      },
      "ReportingGroupAgentVersionChannelPairV2": {
        "type": "object",
        "properties": {
          "early": {
            "type": "string"
          },
          "production": {
            "type": "string"
          }
        },
        "required": [
          "early",
          "production"
        ]
      },
      "ReportingGroupListItemV2ListResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportingGroupListItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "ReportingGroupListItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID del grup de report"
          },
          "name": {
            "type": "string",
            "description": "Nom del grup de report"
          },
          "organization_id": {
            "type": "string",
            "nullable": true,
            "description": "Identificador d'organització"
          },
          "product_config_id": {
            "type": "string",
            "nullable": true,
            "description": "Identificador de configuració de producte"
          },
          "fishing_pattern": {
            "type": "string",
            "nullable": true,
            "description": "Nom del patró de fishing"
          },
          "fishing_pattern_field": {
            "type": "string",
            "enum": [
              "full_name",
              "description",
              "ou",
              "current_subnet"
            ],
            "nullable": true,
            "description": "Camp sobre el qual s'aplica fishing_pattern. Valors possibles: full_name, description, ou, current_subnet."
          },
          "patch_policy_target_id": {
            "type": "string",
            "nullable": true,
            "description": "Identificador de destinació de política de patch"
          },
          "policy_reporting_group": {
            "type": "string",
            "nullable": true,
            "description": "Identificador de grup de report de política"
          },
          "overridden_agent_settings": {
            "$ref": "#/components/schemas/ReportingGroupAgentSettingsV2",
            "nullable": true,
            "description": "Configuració de l'agent sobrescrita a nivell de grup de reporte"
          },
          "effective_agent_settings": {
            "$ref": "#/components/schemas/ReportingGroupEffectiveAgentSettingsV2",
            "nullable": true,
            "description": "Configuració efectiva de l'agent"
          },
          "execute_flexx_analyzer_agent": {
            "type": "boolean",
            "description": "Si l'execució de l'agent FlexxAnalyzer està habilitada"
          },
          "can_manage_agent_versions": {
            "type": "boolean",
            "description": "Indica si el grup de report permet l'autogestió de versions d'agent segons la seva configuració de producte associada"
          },
          "flexx_agent_portal_download": {
            "type": "boolean",
            "description": "Si la descàrrega de FlexxAgent des del portal està habilitada per a l'organització del grup"
          },
          "intermediate_device_1_id": {
            "type": "string",
            "nullable": true,
            "description": "ID de Workspace del primer dispositiu intermedi"
          },
          "intermediate_device_2_id": {
            "type": "string",
            "nullable": true,
            "description": "ID de Workspace del segon dispositiu intermedi"
          },
          "intermediate_device_3_id": {
            "type": "string",
            "nullable": true,
            "description": "ID de Workspace del tercer dispositiu intermedi"
          }
        },
        "required": [
          "id"
        ]
      },
      "GetReportingGroupMonthlyReportResponseV2": {
        "type": "object",
        "description": "Informe mensual de suport d'un grup d'informe.",
        "properties": {
          "reporting_group_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del grup d'informe."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de la organització."
          },
          "period_year": {
            "type": "integer",
            "minimum": 1,
            "description": "Any de l'informe."
          },
          "period_month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "description": "Mes de l'informe."
          },
          "applied_patches": {
            "type": "integer",
            "description": "Nombre de pegats aplicats."
          },
          "critical_patches": {
            "type": "integer",
            "description": "Nombre de pegats crítics."
          },
          "security_patches": {
            "type": "integer",
            "description": "Nombre de pegats de seguretat."
          },
          "other_patches": {
            "type": "integer",
            "description": "Nombre d'altres pegats."
          },
          "total_used_apps": {
            "type": "integer",
            "description": "Quantitat total d'aplicacions usades en el període."
          },
          "top_apps": {
            "type": "array",
            "description": "Aplicacions més usades en el període.",
            "items": {
              "$ref": "#/components/schemas/ReportingGroupMonthlyTopAppV2"
            }
          },
          "automatic_remediations": {
            "$ref": "#/components/schemas/ReportingGroupMonthlyAutomaticRemediationsV2"
          },
          "current_reporting_group_name": {
            "type": "string",
            "description": "Nom actual del grup d'informe."
          },
          "current_total_workspaces": {
            "type": "integer",
            "description": "Total actual d'espais de treball del grup."
          },
          "current_total_workspace_users": {
            "type": "integer",
            "description": "Total actual d'usuaris en espais de treball del grup."
          },
          "current_workspace_antivirus_statistics": {
            "$ref": "#/components/schemas/ReportingGroupMonthlyCurrentWorkspaceAntivirusStatisticsV2"
          }
        },
        "required": [
          "reporting_group_id",
          "organization_id",
          "period_year",
          "period_month",
          "applied_patches",
          "critical_patches",
          "security_patches",
          "other_patches",
          "total_used_apps",
          "top_apps",
          "automatic_remediations",
          "current_reporting_group_name",
          "current_total_workspaces",
          "current_total_workspace_users",
          "current_workspace_antivirus_statistics"
        ]
      },
      "ReportingGroupMonthlyTopAppV2": {
        "type": "object",
        "description": "Aplicació i nombre de dies d'ús durant el període.",
        "properties": {
          "app_name": {
            "type": "string",
            "description": "Nom de l'aplicació."
          },
          "usage_days": {
            "type": "integer",
            "description": "Dies d'ús de l'aplicació."
          }
        },
        "required": [
          "app_name",
          "usage_days"
        ]
      },
      "ReportingGroupMonthlyAutomaticRemediationsV2": {
        "type": "object",
        "description": "Comptador de remediacions automàtiques.",
        "properties": {
          "microservices": {
            "type": "integer",
            "description": "Quantitat de remediacions per microserveis."
          },
          "flows": {
            "type": "integer",
            "description": "Quantitat de remediacions per fluxos."
          }
        },
        "required": [
          "microservices",
          "flows"
        ]
      },
      "ReportingGroupMonthlyCurrentWorkspaceAntivirusStatisticsV2": {
        "type": "object",
        "description": "Estat actual d'antivirus en espais de treball del grup.",
        "properties": {
          "workspaces_without_antivirus": {
            "type": "integer",
            "description": "Quantitat d'espais de treball sense antivirus."
          },
          "workspaces_with_antivirus": {
            "$ref": "#/components/schemas/ReportingGroupMonthlyWorkspacesWithAntivirusV2"
          }
        },
        "required": [
          "workspaces_without_antivirus",
          "workspaces_with_antivirus"
        ]
      },
      "ReportingGroupMonthlyWorkspacesWithAntivirusV2": {
        "type": "object",
        "description": "Resum d'espais de treball amb antivirus.",
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total d'espais de treball amb antivirus."
          },
          "by_status": {
            "$ref": "#/components/schemas/ReportingGroupMonthlyWorkspacesWithAntivirusByStatusV2"
          }
        },
        "required": [
          "total",
          "by_status"
        ]
      },
      "ReportingGroupMonthlyWorkspacesWithAntivirusByStatusV2": {
        "type": "object",
        "description": "Distribució per estat d'antivirus.",
        "properties": {
          "unknown": {
            "type": "integer",
            "description": "Espais de treball amb estat desconegut."
          },
          "not_installed": {
            "type": "integer",
            "description": "Espais de treball amb antivirus no instal·lat."
          },
          "installed_stopped": {
            "type": "integer",
            "description": "Espais de treball amb antivirus instal·lat i detingut."
          },
          "installed_working": {
            "type": "integer",
            "description": "Espais de treball amb antivirus instal·lat i en funcionament."
          }
        },
        "required": [
          "unknown",
          "not_installed",
          "installed_stopped",
          "installed_working"
        ]
      },
      "GetRolesResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetSessionByIdResponseV2": {
        "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": "Identificador de la sessió."
          },
          "user_name": {
            "type": "string",
            "description": "Compte d'usuari per a la sessió."
          },
          "session_type": {
            "type": "string",
            "enum": [
              "vdi_desktop",
              "application",
              "sdi_desktop",
              "device"
            ],
            "description": "Tipus de sessió."
          },
          "windows_session_id": {
            "type": "integer",
            "description": "Identificador de sessió de Windows."
          },
          "connection_state": {
            "type": "string",
            "enum": [
              "unknown",
              "connected",
              "disconnected",
              "terminated",
              "preparing_session",
              "active",
              "reconnecting",
              "non_broker_session",
              "other",
              "pending"
            ],
            "description": "Estat de connexió de la sessió."
          },
          "start_date": {
            "type": "string",
            "description": "Marca de temps d'inici de la sessió."
          },
          "session_status": {
            "type": "string",
            "nullable": true,
            "enum": [
              "empty",
              "active_notifications",
              "active_notifications_ack_accepted",
              "active_notifications_ack_pending"
            ],
            "description": "Estat de la sessió."
          },
          "platform_type": {
            "type": "string",
            "enum": [
              "windows",
              "mac",
              "linux",
              "android",
              "chrome_os",
              "unknown"
            ],
            "description": "Tipus de plataforma."
          },
          "connected": {
            "type": "boolean",
            "description": "Indica si la sessió està connectada actualment."
          },
          "current_session_id": {
            "type": "integer",
            "description": "Identificador actual de la sessió de connexió."
          },
          "current_dc_name": {
            "type": "string",
            "description": "Nom actual del centre de dades."
          },
          "last_connection_time": {
            "type": "string",
            "description": "Cadena de marca de temps de la última connexió."
          },
          "log_on_duration": {
            "type": "number",
            "description": "Durada d'inici de sessió."
          },
          "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": "Clau de sessió."
          },
          "flexx_analyzer_executed": {
            "type": "boolean",
            "description": "Indica si l'execució de l'analitzador s'ha completat."
          },
          "cpu_usage": {
            "type": "number",
            "nullable": true,
            "description": "Ús actual de CPU."
          },
          "ram_usage_gb": {
            "type": "number",
            "nullable": true,
            "description": "Ús actual de RAM en gigabytes."
          },
          "rtt_usage": {
            "type": "number",
            "nullable": true,
            "description": "Ús actual de RTT."
          },
          "current_uid_usage": {
            "type": "number",
            "nullable": true,
            "description": "Ús actual de UID."
          },
          "ram_usage": {
            "type": "number",
            "nullable": true,
            "description": "Ús actual de RAM."
          },
          "ram_percentage": {
            "type": "number",
            "nullable": true,
            "description": "Percentatge actual d'ús de RAM."
          },
          "number_alerts_user": {
            "type": "number",
            "nullable": true,
            "description": "Nombre d'alertes de l'usuari."
          },
          "number_alerts_vm": {
            "type": "number",
            "nullable": true,
            "description": "Nombre d'alertes del Workspace."
          },
          "workspace_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador MongoDB (_id) del Workspace relacionat amb la sessió, resolt a partir de la relació de sessió."
          }
        },
        "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"
        ]
      },
      "GetSessionsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetSessionItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetSessionItemV2": {
        "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": "Identificador de la sessió."
          },
          "user_name": {
            "type": "string",
            "description": "Compte d'usuari de la sessió."
          },
          "session_type": {
            "type": "string",
            "enum": [
              "vdi_desktop",
              "application",
              "sdi_desktop",
              "device"
            ],
            "description": "Tipus de sessió."
          },
          "windows_session_id": {
            "type": "integer",
            "description": "Identificador de sessió de Windows."
          },
          "connection_state": {
            "type": "string",
            "enum": [
              "unknown",
              "connected",
              "disconnected",
              "terminated",
              "preparing_session",
              "active",
              "reconnecting",
              "non_broker_session",
              "other",
              "pending"
            ],
            "description": "Estat de connexió de la sessió."
          },
          "start_date": {
            "type": "string",
            "description": "Marca de temps d'inici de la sessió."
          },
          "cpu_usage": {
            "type": "number",
            "nullable": true,
            "description": "Ús actual de CPU."
          },
          "ram_usage_gb": {
            "type": "number",
            "nullable": true,
            "description": "Ús actual de RAM en gigabytes."
          },
          "rtt_usage": {
            "type": "number",
            "nullable": true,
            "description": "Ús actual de RTT."
          },
          "session_status": {
            "type": "string",
            "description": "Estat de la sessió."
          },
          "platform_type": {
            "type": "string",
            "enum": [
              "windows",
              "mac",
              "linux",
              "android",
              "chrome_os",
              "unknown"
            ],
            "description": "Tipus de plataforma."
          },
          "connected": {
            "type": "boolean",
            "description": "Indicador de connexió actual."
          },
          "current_session_id": {
            "type": "integer",
            "description": "Identificador de sessió de connexió actual."
          },
          "current_dc_name": {
            "type": "string",
            "description": "Nom actual del centre de dades."
          },
          "current_uid_usage": {
            "type": "number",
            "nullable": true,
            "description": "Ús actual de UID."
          },
          "flexx_analyzer_executed": {
            "type": "boolean",
            "description": "Si l'execució de l'analitzador ha finalitzat."
          },
          "last_connection_time": {
            "type": "string",
            "description": "Cadena de marca de temps de la última connexió."
          },
          "log_on_duration": {
            "type": "number",
            "description": "Durada d'inici de sessió."
          },
          "number_alerts_user": {
            "type": "number",
            "nullable": true,
            "description": "Nombre d'alertes de l'usuari."
          },
          "number_alerts_vm": {
            "type": "number",
            "nullable": true,
            "description": "Nombre d'alertes del Workspace."
          },
          "ram_usage": {
            "type": "number",
            "nullable": true,
            "description": "Ús actual de RAM."
          },
          "ram_percentage": {
            "type": "number",
            "nullable": true,
            "description": "Percentatge actual d'ús de RAM."
          },
          "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": "Clau de sessió."
          },
          "workspace_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador MongoDB (_id) del Workspace associat amb la sessió, resolt a partir de la relació de sessió."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'organització associat amb la sessió."
          }
        },
        "required": [
          "id",
          "user_name",
          "session_type",
          "windows_session_id",
          "connection_state",
          "start_date",
          "cpu_usage",
          "ram_usage_gb",
          "rtt_usage",
          "session_status",
          "platform_type",
          "connected",
          "current_session_id",
          "current_dc_name",
          "current_uid_usage",
          "flexx_analyzer_executed",
          "last_connection_time",
          "log_on_duration",
          "number_alerts_user",
          "number_alerts_vm",
          "ram_usage",
          "ram_percentage",
          "session_key",
          "workspace_id",
          "organization_id"
        ]
      },
      "TenantListItemV2ListResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha més pàgines disponibles"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantListItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "TenantListItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID de l'arrendatari"
          },
          "organization_id": {
            "type": "string",
            "description": "ID de l'organització del tenant"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Data de creació (data i hora ISO 8601)"
          },
          "name": {
            "type": "string",
            "description": "Nom del tenant"
          },
          "region": {
            "type": "string",
            "description": "Regió/ID de regió"
          },
          "product_id": {
            "type": "string",
            "nullable": true,
            "description": "Identificador del producte (nullable si el tenant no té producte assignat)"
          },
          "policy_id": {
            "type": "string",
            "nullable": true,
            "description": "Identificador de la política (nullable si el tenant no té política assignada)"
          }
        },
        "required": [
          "id"
        ]
      },
      "GetUsersResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserByIdV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "WorkspacePublicV2": {
        "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."
          },
          "created_at": {
            "type": "string",
            "nullable": true
          },
          "last_deregistration_time": {
            "type": "string",
            "nullable": true
          },
          "delete_scheduled_at": {
            "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"
        ]
      },
      "WorkspaceGroupScheduleV2ListResponseV2": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkspaceGroupScheduleV2"
            },
            "description": "Arranjament de programacions cron per al grup de workspaces"
          }
        },
        "required": [
          "data"
        ]
      },
      "WorkspaceGroupWorkspaceItemV2": {
        "type": "object",
        "description": "Element Workspace en la llista de Workspaces del grup de workspaces (projecció reduïda).",
        "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
          },
          "ip_address": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "last_user": {
            "type": "string",
            "nullable": true
          },
          "total_ram": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "id"
        ]
      },
      "WorkspaceGroupWorkspaceListResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkspaceGroupWorkspaceItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "WorkspaceGroupListItemV2ListResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkspaceGroupListItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "WorkspaceGroupListItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "description": "ID del grup de workspaces"
          },
          "name": {
            "type": "string",
            "description": "Nom del grup de workspaces"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Descripció del grup de workspaces"
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "description": "Identificador de l'organització"
          },
          "created_by": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "description": "ID de l'usuari que va crear el grup de workspaces"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Marca de temps de creació"
          },
          "type": {
            "type": "string",
            "nullable": true,
            "enum": [
              "static",
              "dynamic",
              "entra_id"
            ],
            "description": "Tipus de grups de workspaces"
          },
          "filter": {
            "type": "string",
            "nullable": true,
            "description": "Cadena de filtratge per als grups de workspaces dinàmics"
          },
          "location": {
            "$ref": "#/components/schemas/WorkspaceLocationV2",
            "nullable": true,
            "description": "Informació de ubicació del grup de workspaces"
          },
          "entra_id_source": {
            "$ref": "#/components/schemas/WorkspaceGroupEntraIdSourceV2",
            "nullable": true,
            "description": "Informació d'origen de Entra ID per al grup de workspaces"
          }
        },
        "required": [
          "id"
        ]
      },
      "WorkspaceListResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkspacePublicV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "ReplaceDigitalActivityCoreProcessGroupCoreProcessesRequestV2": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "core_processes": {
            "type": "array",
            "description": "Col·lecció completa de processos core que substitueix l'estat actual del grup.",
            "items": {
              "$ref": "#/components/schemas/ReplaceDigitalActivityCoreProcessItemV2"
            }
          }
        },
        "required": [
          "core_processes"
        ],
        "description": "Cos de reemplaçament complet de processos core del grup."
      },
      "ReplaceDigitalActivityCoreProcessItemV2": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Nom funcional del procés core."
          },
          "process_name": {
            "type": "string",
            "description": "Nom del procés del sistema operatiu."
          }
        },
        "required": [
          "name",
          "process_name"
        ]
      },
      "GetCoreProcessGroupCoreProcessesResponseV2": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReplaceDigitalActivityCoreProcessItemV2"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "UpdateDigitalActivityCoreProcessGroupRequestV2": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Nom del grup de processos core."
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Descripció del grup de processos core."
          },
          "workspace_group_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del grup de workspaces associat."
          }
        },
        "required": [
          "name",
          "description",
          "workspace_group_id"
        ],
        "description": "Cos d'actualització completa del grup de processos core."
      },
      "UpdateFlowV2Request": {
        "type": "object",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/MultilangField",
            "description": "Nom del flux. Es requereix almenys una clau d'idioma; cada valor entre 1 i 512 caràcters."
          },
          "description": {
            "$ref": "#/components/schemas/MultilangField",
            "description": "Descripció del flux. Es requereix almenys una clau d'idioma; cada valor entre 1 i 512 caràcters."
          },
          "detection_only": {
            "type": "boolean"
          },
          "cooldown_minutes": {
            "type": "number",
            "minimum": 10,
            "maximum": 1440,
            "description": "Temps d'espera en minuts. Ha d'estar entre 10 i 1440."
          },
          "enabled": {
            "type": "boolean",
            "description": "Indica si el flux està habilitat. PUT espera una definició completa; aquest camp és obligatori."
          },
          "init_text": {
            "$ref": "#/components/schemas/MultilangField",
            "nullable": true,
            "description": "Missatge de text inicial. Obligatori en PUT. Envia null per netejar; en cas contrari, objecte amb almenys una clau d'idioma; cada valor entre 1 i 512 caràcters."
          },
          "ok_text": {
            "$ref": "#/components/schemas/MultilangField",
            "nullable": true,
            "description": "Missatge de text d'èxit. Obligatori en PUT. Envia null per netejar; en cas contrari, objecte amb almenys una clau d'idioma; cada valor entre 1 i 512 caràcters."
          },
          "ko_text": {
            "$ref": "#/components/schemas/MultilangField",
            "nullable": true,
            "description": "Missatge de text d'error. Obligatori en PUT. Envia null per netejar; en cas contrari, objecte amb almenys una clau d'idioma; cada valor entre 1 i 512 caràcters."
          },
          "target": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "all_workspaces",
                  "workspaces",
                  "workspace_groups",
                  "reporting_groups"
                ]
              },
              "ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 512
                }
              }
            },
            "required": [
              "type"
            ]
          },
          "microservice_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$"
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowConditionInputV2"
            }
          }
        },
        "required": [
          "name",
          "description",
          "detection_only",
          "cooldown_minutes",
          "enabled",
          "init_text",
          "ok_text",
          "ko_text",
          "target",
          "microservice_id",
          "conditions"
        ]
      },
      "UpdateReportingGroupAgentVersionsRequestV2": {
        "type": "object",
        "properties": {
          "agent_auto_update": {
            "type": "boolean"
          },
          "versions": {
            "$ref": "#/components/schemas/ReportingGroupAgentVersionsV2"
          }
        },
        "required": [
          "agent_auto_update",
          "versions"
        ]
      },
      "UpdateReportingGroupRequestV2": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 512,
            "description": "El nom del grup de reporte. Ha de ser únic dins de l'organització.",
            "example": "Grupo de reporte de producción actualizado"
          },
          "description": {
            "type": "string",
            "maxLength": 1000,
            "description": "Opcional. Una descripció del propòsit i ús del grup de reporte.",
            "example": "Grupo de reporte actualizado para entornos de producción"
          },
          "patch_policy_target_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Opcional. L'identificador únic de la destinació de política de pegats que s'associarà amb aquest grup de report. Estableix-ho a null o omet aquest camp per eliminar l'associació.",
            "example": "507f1f77bcf86cd799439040"
          },
          "fishing_pattern": {
            "type": "string",
            "maxLength": 250,
            "description": "Opcional. Un patró d'expressió regular utilitzat per coincidir dispositius. Ha de ser un patró regex vàlid. Si es proporciona, també s'ha d'especificar fishing_pattern_field. Omiteix-lo per eliminar el patró.",
            "example": "Estaciones de trabajo Windows"
          },
          "fishing_pattern_field": {
            "type": "string",
            "enum": [
              "full_name",
              "description",
              "ou",
              "current_subnet"
            ],
            "description": "Opcional. Camp sobre el qual s'aplica fishing_pattern. Obligatori si es proporciona fishing_pattern. Valors vàlids: full_name (nom complet del dispositiu), description (descripció del dispositiu), ou (unitat organitzativa), current_subnet (subxarxa actual).",
            "example": "full_name"
          },
          "intermediate_device_1_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Opcional. L'identificador únic del Workspace del primer dispositiu intermedi. Els dispositius intermedis s'utilitzen per a accions Wake-on-LAN en xarxes segures, permetent l'encesa remot dels dispositius objectiu a través de passarel·les intermediàries. Els dispositius intermedis han de definir-se seqüencialment i sense buits. Si es omet, es netejaran tots els dispositius intermedis. Si es proporcionen intermediate_device_2_id o intermediate_device_3_id, aquest camp és obligatori.",
            "example": "507f1f77bcf86cd799439050"
          },
          "intermediate_device_2_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Opcional. L'identificador únic del Workspace del segon dispositiu intermedi. S'utilitza per a accions Wake-on-LAN en xarxes segures. Requereix que es proporcioni intermediate_device_1_id. Si es omet mentre intermediate_device_1_id està proporcionat, aquest i intermediate_device_3_id es netejaran. Si es proporciona intermediate_device_3_id, aquest camp és obligatori.",
            "example": "507f1f77bcf86cd799439051"
          },
          "intermediate_device_3_id": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Opcional. L'identificador únic del Workspace del tercer dispositiu intermedi. S'utilitza per a accions Wake on LAN en xarxes segures. Requereix que es proporcionin intermediate_device_1_id i intermediate_device_2_id. Si es omet mentre intermediate_device_1_id i intermediate_device_2_id estan proporcionats, aquest camp es netejarà.",
            "example": "507f1f77bcf86cd799439052"
          }
        },
        "required": [
          "name"
        ],
        "description": "Cos de la sol·licitud per actualitzar un grup de reporte existent. Aquest endpoint implementa semàntica de reemplaçament complet: tots els camps actualitzables han d'incloure's. Ometre camps opcionals els netejarà (comportament idempotent). Els dispositius intermedis s'utilitzen per a accions Wake on LAN en xarxes segures, permetent l'encesa remot de dispositius a través de passarel·les intermediàries. Els dispositius intermedis han de definir-se seqüencialment: no pots definir intermediate_device_2_id sense intermediate_device_1_id, ni intermediate_device_3_id sense intermediate_device_2_id. Tots els IDs de Workspace de dispositius intermedis han d'existir i pertànyer a l'organització."
      },
      "UpdateRoleRequestV2": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Nom del rol d'usuari."
          },
          "permissions": {
            "type": "array",
            "minItems": 1,
            "description": "Entrades completes de permisos que defineixen l'estat final del rol.",
            "items": {
              "$ref": "#/components/schemas/UpdateRolePermissionItemV2"
            }
          }
        },
        "required": [
          "name",
          "permissions"
        ]
      },
      "UpdateRolePermissionItemV2": {
        "type": "object",
        "properties": {
          "target_organization": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "all"
                ]
              },
              {
                "type": "string",
                "pattern": "^[0-9a-f]{24}$",
                "minLength": 24,
                "maxLength": 24
              }
            ],
            "description": "Abast d'organització del permís. Useu 'all' per a totes les organitzacions o un 'organization_id' concret."
          },
          "portal_permission": {
            "type": "string",
            "enum": [
              "admin",
              "organization_admin",
              "organization_admin_read_only",
              "user",
              "platform",
              "l1_support_team",
              "l1_support_team_read_only",
              "l2_support_team",
              "l2_support_team_read_only",
              "l3_engineering_team",
              "l3_engineering_team_read_only",
              "billing"
            ],
            "description": "Nivell de permís de Portal."
          },
          "workspaces_permission": {
            "type": "string",
            "enum": [
              "no_access",
              "l1_support_team_read_only",
              "l1_support_team",
              "l2_support_team_read_only",
              "l2_support_team",
              "l3_engineering_team_read_only",
              "l3_engineering_team",
              "admin_read_only",
              "admin"
            ],
            "description": "Nivell de permís de Workspace."
          },
          "analyzer_permission": {
            "type": "string",
            "enum": [
              "no_access",
              "access",
              "admin"
            ],
            "description": "Nivell de permís d'Analyzer."
          },
          "target_reporting_groups": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "all"
                ]
              },
              {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{24}$",
                  "minLength": 24,
                  "maxLength": 24
                }
              }
            ],
            "description": "Abast de reporting groups del permís. Useu 'all' per a tots els grups o una llista de 'reporting_group_id'."
          }
        },
        "required": [
          "target_organization",
          "portal_permission",
          "workspaces_permission",
          "analyzer_permission",
          "target_reporting_groups"
        ]
      },
      "UpdateTenantRequestV2": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 512
          }
        },
        "required": [
          "name"
        ]
      },
      "UpdateUserRequestV2": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Nom de l'usuari."
          },
          "surname": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Cognom de l'usuari."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Adreça de correu electrònic de l'usuari."
          },
          "department": {
            "type": "string",
            "nullable": true,
            "description": "Departament de l'usuari."
          },
          "role_id": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del rol assignat a l'usuari."
          }
        },
        "required": [
          "name",
          "surname",
          "email",
          "department",
          "role_id"
        ]
      },
      "UpdateWorkspaceGroupScheduleRequestV2": {
        "type": "object",
        "properties": {
          "cron_expression": {
            "type": "string",
            "description": "Expressió cron que defineix quan s'ha d'executar la programació. Format: minut hora dia-del-mes mes dia-de-la-setmana. Exemples: '0 8 * * 1-5' (8 AM entre setmana), '0 0 * * 0' (mitjanit del diumenge), '30 14 * * *' (2:30 PM diàriament). Dia-de-la-setmana: 0=diumenge, 1=dilluns, ..., 6=dissabte. Admet rangs (1-5), llistes (1,3,5) i comodins (*). Ha de ser un format d'expressió cron vàlid amb 5 camps separats per espais.",
            "example": "0 8 * * 1-5"
          },
          "time_zone": {
            "type": "string",
            "description": "Zona horària per a l'execució de la programació. Admet identificadors IANA (per exemple, 'America/New_York') i Windows (per exemple, 'Pacific Standard Time').",
            "example": "Eastern Standard Time"
          },
          "type": {
            "type": "string",
            "enum": [
              "start",
              "stop",
              "restart"
            ],
            "description": "Tipus d'operació d'energia a realitzar. START: Encén els Workspaces del grup. STOP: Apaga els Workspaces del grup. RESTART: Reinicia els Workspaces del grup.",
            "example": "start"
          },
          "intermediate_device": {
            "type": "string",
            "maxLength": 24,
            "pattern": "^[0-9a-f]{24}$",
            "description": "Opcional. L'identificador únic del Workspace de dispositiu intermedi. Si es proporciona, indica que s'ha d'utilitzar un dispositiu intermedi per a operacions de Wake-on-LAN. Només aplica a programacions START. S'utilitza per a accions de Wake-on-LAN en xarxes segures. El Workspace ha d'existir i pertànyer a l'organització. Per eliminar un dispositiu intermedi, omet aquest camp.",
            "example": "507f1f77bcf86cd799439050"
          }
        },
        "required": [
          "cron_expression",
          "time_zone",
          "type"
        ]
      },
      "WorkspaceGroupUpdateRequestV2": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 512
          },
          "description": {
            "type": "string",
            "maxLength": 512
          },
          "location": {
            "$ref": "#/components/schemas/WorkspaceGroupBaseUpdateLocationInputV2"
          }
        },
        "required": [
          "name",
          "description",
          "location"
        ]
      },
      "UpdateWorkspaceGroupWorkspacesResponseV2": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Missatge de confirmació de l'actualització"
          },
          "total_in_group": {
            "type": "integer",
            "description": "Total de Workspaces en el grup després d'aplicar l'actualització"
          }
        },
        "required": [
          "message",
          "total_in_group"
        ]
      },
      "WorkspacesUpdateRequestV2": {
        "type": "object",
        "properties": {
          "workspace_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 24,
              "pattern": "^[0-9a-f]{24}$"
            },
            "description": "Arranjament de IDs de Workspace"
          }
        },
        "required": [
          "workspace_ids"
        ]
      },
      "WorkspaceAgentVersionItemV2": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "discovered_at",
          "version"
        ],
        "properties": {
          "discovered_at": {
            "type": "string",
            "format": "date-time",
            "description": "Data en què es va detectar la versió de l'agent."
          },
          "version": {
            "type": "string",
            "description": "Versió de l'agent detectada al workspace."
          }
        }
      },
      "GetWorkspaceAgentVersionsResponseV2": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "has_next"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkspaceAgentVersionItemV2"
            }
          },
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha més resultats a la següent pàgina."
          }
        }
      },
      "GetWorkspaceAlertsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetWorkspaceAlertItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetWorkspaceAlertItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador d'alerta."
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Nom de l'alerta."
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Descripció de l'alerta."
          },
          "severity": {
            "type": "string",
            "enum": [
              "critical",
              "warning",
              "informational"
            ],
            "nullable": true,
            "description": "Severitat de l'alerta en minúscules. Serà null quan l'origen de les dades no sigui vàlid."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Marca de temps d'inici de l'alerta."
          },
          "authorized_minutes": {
            "type": "number",
            "nullable": true,
            "description": "Durada autoritzada en minuts."
          },
          "notified_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Marca de temps de notificació."
          },
          "information": {
            "type": "string",
            "nullable": true,
            "description": "Informació addicional de l'alerta."
          },
          "threshold_unit_name": {
            "type": "string",
            "nullable": true,
            "description": "Nom de la unitat del llindar."
          },
          "threshold_value": {
            "type": "number",
            "nullable": true,
            "description": "Valor del llindar."
          },
          "element": {
            "type": "string",
            "nullable": true,
            "description": "Element afectat."
          },
          "category": {
            "type": "string",
            "nullable": true,
            "description": "Categoria de l'alerta."
          }
        },
        "required": [
          "id"
        ]
      },
      "GetWorkspaceDisksResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetWorkspaceDiskItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetWorkspaceDiskItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del registre de disc."
          },
          "name": {
            "type": "string",
            "description": "Nom del disc."
          },
          "device_id": {
            "type": "string",
            "description": "Cadena identificadora del dispositiu de disc."
          },
          "encrypted": {
            "type": "string",
            "enum": [
              "not_encrypted",
              "encrypted",
              "partially_encrypted",
              "na"
            ],
            "description": "Estat d'encriptació del disc."
          },
          "encryption_method": {
            "type": "string",
            "description": "Etiqueta del mètode d'encriptació."
          },
          "location": {
            "type": "string",
            "description": "Etiqueta de la ubicació del disc."
          },
          "media_type": {
            "type": "string",
            "description": "Tipus de medi del disc."
          },
          "os_drive": {
            "type": "boolean",
            "nullable": true,
            "description": "Si el disc està marcat com a unitat del SO."
          },
          "partition": {
            "type": "string",
            "description": "Descriptor de partició."
          },
          "physical_disk_size": {
            "type": "number",
            "description": "Valor de la mida física del disc."
          },
          "total_size": {
            "type": "number",
            "description": "Valor de la mida total del disc."
          },
          "last_updated_at": {
            "type": "string",
            "description": "Data de l'última actualització del registre de disc."
          },
          "used_size": {
            "type": "number",
            "description": "Valor de la mida usada del disc."
          },
          "volume_label": {
            "type": "string",
            "description": "Etiqueta de volum."
          }
        },
        "required": [
          "id",
          "name",
          "device_id",
          "encrypted",
          "encryption_method",
          "location",
          "partition",
          "physical_disk_size",
          "total_size"
        ]
      },
      "GetWorkspaceInstalledAppsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetWorkspaceInstalledAppItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetWorkspaceInstalledAppItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'aplicació instal·lada."
          },
          "product_name": {
            "type": "string",
            "description": "Nom de l'aplicació instal·lada."
          },
          "publisher": {
            "type": "string",
            "nullable": true,
            "description": "Publicador de l'aplicació instal·lada."
          },
          "version": {
            "type": "string",
            "nullable": true,
            "description": "Versió de l'aplicació instal·lada."
          },
          "installed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Marca temporal d'instal·lació."
          },
          "install_location": {
            "type": "string",
            "nullable": true,
            "description": "Ubicació d'instal·lació."
          },
          "last_reported_at": {
            "type": "string",
            "format": "date-time",
            "description": "Marca temporal del darrer informe."
          }
        },
        "required": [
          "id",
          "product_name",
          "last_reported_at"
        ]
      },
      "GetWorkspaceOperationsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetOperationByIdResponseV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetWorkspacePatchesResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetWorkspacePatchItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetWorkspacePatchItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del registre del pegall."
          },
          "kb": {
            "type": "string",
            "description": "Codi KB del pegall."
          },
          "title": {
            "type": "string",
            "description": "Títol del pegall."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "installed"
            ],
            "description": "Estat del pegall."
          },
          "product": {
            "type": "string",
            "description": "Producte associat al pegall."
          },
          "severity": {
            "type": "string",
            "description": "Severitat del pegall."
          },
          "arrived_at": {
            "type": "string",
            "description": "Data d'arribada o publicació del pegall."
          },
          "category": {
            "type": "string",
            "description": "Categoria del pegall."
          },
          "installed_at": {
            "type": "string",
            "nullable": true,
            "description": "Data d'instal·lació del pegall."
          },
          "additional_information_url": {
            "type": "string",
            "description": "URL amb informació addicional del pegall."
          }
        },
        "required": [
          "id",
          "kb",
          "title",
          "status",
          "product",
          "severity",
          "arrived_at",
          "category",
          "additional_information_url"
        ]
      },
      "GetWorkspacePnpErrorsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetWorkspacePnpErrorItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetWorkspacePnpErrorItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del registre d'error de PnP."
          },
          "name": {
            "type": "string",
            "description": "Nom de l'error."
          },
          "status": {
            "type": "string",
            "description": "Estat de l'error."
          },
          "class": {
            "type": "string",
            "description": "Classe del dispositiu."
          },
          "device_id": {
            "type": "string",
            "description": "Identificador del dispositiu."
          },
          "error_description": {
            "type": "string",
            "description": "Descripció de l'error."
          },
          "error_code": {
            "type": "string",
            "description": "Codi de l'error."
          },
          "properties": {
            "type": "string",
            "description": "Propietats addicionals."
          },
          "last_updated_at": {
            "type": "string",
            "description": "Data de l'última actualització."
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "class",
          "device_id",
          "error_description",
          "error_code",
          "properties",
          "last_updated_at"
        ]
      },
      "GetWorkspacePnpEventsResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetWorkspacePnpEventItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetWorkspacePnpEventItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de l'esdeveniment."
          },
          "action": {
            "type": "string",
            "description": "Etiqueta de l'acció."
          },
          "created_at": {
            "type": "string",
            "description": "Cadena de data de l'esdeveniment."
          },
          "user_name": {
            "type": "string",
            "description": "Usuari associat a l'esdeveniment."
          },
          "caption": {
            "type": "string",
            "description": "Llegenda de l'esdeveniment."
          },
          "device_id": {
            "type": "string",
            "description": "Identificador del dispositiu associat a l'esdeveniment."
          }
        },
        "required": [
          "id",
          "action",
          "created_at",
          "user_name",
          "caption",
          "device_id"
        ]
      },
      "GetWorkspaceServicesResponseV2": {
        "type": "object",
        "properties": {
          "has_next": {
            "type": "boolean",
            "description": "Indica si hi ha una altra pàgina disponible."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetWorkspaceServiceItemV2"
            }
          }
        },
        "required": [
          "has_next",
          "data"
        ]
      },
      "GetWorkspaceServiceItemV2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador del servei."
          },
          "name": {
            "type": "string",
            "description": "Nom del servei."
          },
          "description": {
            "type": "string",
            "description": "Descripció del servei."
          },
          "status": {
            "type": "string",
            "description": "Estat del servei."
          },
          "accept_stop": {
            "type": "boolean",
            "nullable": true,
            "description": "Indica si el servei accepta sol·licituds de detenció."
          },
          "display_name": {
            "type": "string",
            "description": "Nom per mostrar del servei."
          },
          "log_on_as": {
            "type": "string",
            "description": "Compte usat per executar el servei."
          },
          "path": {
            "type": "string",
            "description": "Ruta executable del servei."
          },
          "organization_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador d'organització associat al servei."
          },
          "reporting_group_id": {
            "type": "string",
            "description": "Identificador del grup de report associat al servei."
          },
          "startup_type": {
            "type": "string",
            "description": "Tipus d'inici del servei."
          },
          "last_updated_at": {
            "type": "string",
            "description": "Cadena de marca temporal de l'última actualització."
          },
          "workspace_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$",
            "minLength": 24,
            "maxLength": 24,
            "description": "Identificador de Workspace associat al servei."
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "status",
          "display_name",
          "log_on_as",
          "path",
          "organization_id",
          "reporting_group_id",
          "startup_type",
          "last_updated_at",
          "workspace_id"
        ]
      }
    },
    "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"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "Entitat no processable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflicte",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ]
}
