{
  "openapi": "3.1.0",
  "info": {
    "title": "NooriACS API",
    "version": "v1",
    "summary": "Versão do sistema 2026.11.15-retencao.3 · ambiente PRODUCTION",
    "description": "ACS SaaS multiempresa. Todo recurso operacional é resolvido pelo tenant da credencial autenticada; nunca por parâmetro enviado pelo cliente."
  },
  "servers": [
    {
      "url": "https://nooriacs.hosthub.net.br/",
      "description": "Origem da aplicação"
    }
  ],
  "security": [
    {
      "sessionCookie": []
    }
  ],
  "paths": {
    "/health/live": {
      "get": {
        "operationId": "healthLive",
        "summary": "Liveness sem dependência externa.",
        "security": [],
        "responses": {
          "200": {
            "description": "Aplicação no ar."
          }
        }
      }
    },
    "/health/ready": {
      "get": {
        "operationId": "healthReady",
        "summary": "Readiness: confirma o PostgreSQL antes de responder.",
        "security": [],
        "responses": {
          "200": {
            "description": "Pronto para receber tráfego."
          }
        }
      }
    },
    "/docs": {
      "get": {
        "operationId": "apiDocsPage",
        "summary": "Documentação visual deste sistema.",
        "security": [],
        "responses": {
          "200": {
            "description": "Página HTML."
          }
        }
      }
    },
    "/docs/openapi.json": {
      "get": {
        "operationId": "apiDocsJson",
        "summary": "Este documento.",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 em JSON."
          }
        }
      }
    },
    "/docs/openapi.yaml": {
      "get": {
        "operationId": "apiDocsYaml",
        "summary": "Este documento em YAML.",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 em YAML."
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "summary": "Consultar identidade global e vínculo da empresa atual",
        "operationId": "getApiV1Me",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Atualizar somente campos pessoais permitidos",
        "operationId": "patchApiV1Me",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfilePatch"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ]
      }
    },
    "/api/v1/me/change-password": {
      "post": {
        "summary": "Alterar senha local global e revogar outras sessões por padrão",
        "operationId": "postApiV1MeChange-Password",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Updated"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordChange"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ]
      }
    },
    "/api/platform/v1/me/change-password": {
      "post": {
        "summary": "Alterar senha local global e revogar outras sessões por padrão (painel SaaS)",
        "description": "Mesma regra e mesmo caso de uso da rota de tenant, acessada pela sessão de plataforma (cookie nooriacs_platform_session). A senha pertence à identidade global; a auditoria é gravada em platform_audit_logs porque o contexto de plataforma não tem tenant. Não exige permissão de plataforma: qualquer sessão válida troca a própria senha.",
        "operationId": "platformChangeOwnPassword",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Updated"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordChange"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ]
      }
    },
    "/api/v1/me/permissions": {
      "get": {
        "summary": "Consultar permissões efetivas, sem editá-las",
        "operationId": "getApiV1MePermissions",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenantId": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "permissions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "tenantId",
                    "role",
                    "permissions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/sessions": {
      "get": {
        "summary": "Consultar até 100 sessões próprias da empresa atual",
        "operationId": "getApiV1MeSessions",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Session"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/sessions/revoke-others": {
      "post": {
        "summary": "Revogar outras sessões próprias da empresa atual",
        "operationId": "postApiV1MeSessionsRevoke-Others",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "revoked": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "revoked"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ]
      }
    },
    "/api/v1/me/sessions/{sessionId}": {
      "delete": {
        "summary": "Revogar sessão própria preservando motivo e data anteriores",
        "operationId": "deleteApiV1MeSessionsSessionid",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "revoked": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "revoked"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          },
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/me/security-events": {
      "get": {
        "summary": "Consultar somente eventos ACCOUNT do próprio usuário e empresa",
        "operationId": "getApiV1MeSecurity-Events",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SecurityEvent"
                      }
                    },
                    "page": {
                      "type": "integer"
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "items",
                    "page",
                    "hasMore"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "event",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "result",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ip",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "device",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 1
            }
          }
        ]
      }
    },
    "/api/v1/me/mfa": {
      "get": {
        "summary": "Consultar estado do autenticador",
        "operationId": "getApiV1MeMfa",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaState"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/mfa/totp/setup": {
      "post": {
        "summary": "Iniciar TOTP com reautenticação; segredo retornado uma vez, sem cache",
        "operationId": "postApiV1MeMfaTotpSetup",
        "responses": {
          "201": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaSetup"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ]
      }
    },
    "/api/v1/me/mfa/totp/enroll": {
      "post": {
        "summary": "Iniciar TOTP com reautenticação; segredo retornado uma vez, sem cache",
        "operationId": "postApiV1MeMfaTotpEnroll",
        "responses": {
          "201": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaSetup"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ]
      }
    },
    "/api/v1/me/mfa/totp/confirm": {
      "post": {
        "summary": "Confirmar TOTP; retornar códigos de recuperação uma vez",
        "operationId": "postApiV1MeMfaTotpConfirm",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaResult"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ]
      }
    },
    "/api/v1/me/mfa/totp/verify": {
      "post": {
        "summary": "Confirmar TOTP; retornar códigos de recuperação uma vez",
        "operationId": "postApiV1MeMfaTotpVerify",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaResult"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ]
      }
    },
    "/api/v1/me/mfa/disable": {
      "post": {
        "summary": "Reautenticar e consumir TOTP ou recuperação antes da ação global",
        "operationId": "postApiV1MeMfaDisable",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaResult"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ]
      }
    },
    "/api/v1/me/mfa/recovery-codes": {
      "post": {
        "summary": "Reautenticar e consumir TOTP ou recuperação antes da ação global",
        "operationId": "postApiV1MeMfaRecovery-Codes",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaResult"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ]
      }
    },
    "/api/v1/me/avatar": {
      "get": {
        "summary": "Ler a foto privada da própria identidade",
        "operationId": "getApiV1MeAvatar",
        "responses": {
          "200": {
            "description": "Imagem privada; Cache-Control no-store, nosniff",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Salvar imagem validada no storage existente, até 2 MiB",
        "operationId": "postApiV1MeAvatar",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updated": {
                      "type": "boolean"
                    },
                    "hasAvatar": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "updated",
                    "hasAvatar"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 2097152
              }
            },
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 2097152
              }
            },
            "image/webp": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 2097152
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remover vínculo da foto atual",
        "operationId": "deleteApiV1MeAvatar",
        "responses": {
          "200": {
            "description": "Resposta atual da conta autenticada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updated": {
                      "type": "boolean"
                    },
                    "hasAvatar": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "updated",
                    "hasAvatar"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ]
      }
    },
    "/api/v1/users/{id}": {
      "get": {
        "operationId": "getTenantUser",
        "summary": "Consultar usuário da equipe",
        "description": "Exige users:manage e membership do alvo na empresa da sessão. Mutação exige Origin legítima. Nunca afeta sessões de outra empresa.",
        "responses": {
          "200": {
            "description": "Resultado autorizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantUser"
                }
              }
            }
          },
          "400": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/users/{id}/sessions": {
      "get": {
        "operationId": "getTenantUserSessions",
        "summary": "Consultar sessões da equipe",
        "description": "Exige users:manage e membership do alvo na empresa da sessão. Mutação exige Origin legítima. Nunca afeta sessões de outra empresa.",
        "responses": {
          "200": {
            "description": "Resultado autorizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdminSession"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/users/{id}/audit": {
      "get": {
        "operationId": "getTenantUserAudit",
        "summary": "Consultar atividades da equipe",
        "description": "Exige users:manage e membership do alvo na empresa da sessão. Mutação exige Origin legítima. Nunca afeta sessões de outra empresa.",
        "responses": {
          "200": {
            "description": "Resultado autorizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdminEvent"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/users/{id}/permissions": {
      "get": {
        "operationId": "getTenantUserPermissions",
        "summary": "Consultar permissões efetivas",
        "description": "Exige users:manage e membership do alvo na empresa da sessão. Mutação exige Origin legítima. Nunca afeta sessões de outra empresa.",
        "responses": {
          "200": {
            "description": "Resultado autorizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminPermissions"
                }
              }
            }
          },
          "400": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/users/{id}/roles": {
      "put": {
        "operationId": "assignTenantUserRoles",
        "summary": "Substituir seleção de papéis",
        "description": "Exige users:manage e membership do alvo na empresa da sessão. Mutação exige Origin legítima. Nunca afeta sessões de outra empresa.",
        "responses": {
          "200": {
            "description": "Resultado autorizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleAssignment"
                }
              }
            }
          },
          "400": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleAssignment"
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/users/{id}/sessions/revoke": {
      "post": {
        "operationId": "revokeTenantUserSessions",
        "summary": "Encerrar sessões da equipe",
        "description": "Exige users:manage e membership do alvo na empresa da sessão. Mutação exige Origin legítima. Nunca afeta sessões de outra empresa.",
        "responses": {
          "200": {
            "description": "Resultado autorizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "revoked": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "revoked"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    },
    "/api/v1/users/role-matrix": {
      "get": {
        "operationId": "getTenantRoleMatrix",
        "summary": "Consultar matriz de papéis",
        "description": "Exige users:manage e membership do alvo na empresa da sessão. Mutação exige Origin legítima. Nunca afeta sessões de outra empresa.",
        "responses": {
          "200": {
            "description": "Resultado autorizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleMatrix"
                }
              }
            }
          },
          "400": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{id}/avatar": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getTenantUserAvatar",
        "summary": "Consultar foto privada da equipe",
        "description": "Exige users:manage e membership do alvo na empresa da sessão. Mutação exige Origin legítima. Nunca afeta sessões de outra empresa.",
        "responses": {
          "200": {
            "description": "Imagem privada, Cache-Control no-store e nosniff",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro seguro",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/forgot-password": {
      "post": {
        "summary": "Solicitar recuperação com resposta neutra",
        "operationId": "postApiV1AuthForgotPassword",
        "responses": {
          "202": {
            "description": "Solicitar recuperação com resposta neutra",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailMessage"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPassword"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/reset-password": {
      "post": {
        "summary": "Consumir link de recuperação uma única vez",
        "operationId": "postApiV1AuthResetPassword",
        "responses": {
          "200": {
            "description": "Consumir link de recuperação uma única vez",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailUpdated"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPassword"
              }
            }
          }
        }
      }
    },
    "/api/v1/me/email/change-request": {
      "post": {
        "summary": "Solicitar confirmação de novo e-mail",
        "operationId": "postApiV1MeEmailChangeRequest",
        "responses": {
          "202": {
            "description": "Solicitar confirmação de novo e-mail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailMessage"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailChange"
              }
            }
          }
        }
      }
    },
    "/api/v1/me/email/confirm": {
      "post": {
        "summary": "Confirmar e-mail e invalidar links antigos",
        "operationId": "postApiV1MeEmailConfirm",
        "responses": {
          "200": {
            "description": "Confirmar e-mail e invalidar links antigos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailUpdated"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailConfirmation"
              }
            }
          }
        }
      }
    },
    "/api/v1/me/mfa/session/verify": {
      "post": {
        "summary": "Verificar fator existente na sessão atual",
        "operationId": "postApiV1MeMfaSessionVerify",
        "responses": {
          "200": {
            "description": "Verificar fator existente na sessão atual",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MfaSessionVerified"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaSessionVerification"
              }
            }
          }
        }
      }
    },
    "/api/v1/account-mail/settings": {
      "get": {
        "summary": "Consultar configuração sem credenciais",
        "operationId": "getApiV1AccountMailSettings",
        "responses": {
          "200": {
            "description": "Consultar configuração sem credenciais",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailSettings"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Exige users:manage e settings:manage no tenant atual."
      },
      "put": {
        "summary": "Configurar envio por empresa com revisão",
        "operationId": "putApiV1AccountMailSettings",
        "responses": {
          "200": {
            "description": "Configurar envio por empresa com revisão",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailSettings"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Exige users:manage e settings:manage no tenant atual.",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailSettingsUpdate"
              }
            }
          }
        }
      }
    },
    "/api/v1/account-mail/logs": {
      "get": {
        "summary": "Histórico sanitizado dos envios",
        "operationId": "getApiV1AccountMailLogs",
        "responses": {
          "200": {
            "description": "Histórico sanitizado dos envios",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailLogPage"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Exige users:manage e settings:manage no tenant atual.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ]
      }
    },
    "/api/v1/account-mail/test": {
      "post": {
        "summary": "Agendar teste para o próprio e-mail",
        "operationId": "postApiV1AccountMailTest",
        "responses": {
          "202": {
            "description": "Agendar teste para o próprio e-mail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailTest"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Exige users:manage e settings:manage no tenant atual.",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/users/events": {
      "get": {
        "summary": "Consultar eventos versionados de identidade",
        "operationId": "getApiV1UsersEvents",
        "responses": {
          "200": {
            "description": "Consultar eventos versionados de identidade",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountEventPage"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Exige users:manage e audit:read no tenant atual. Journal de eventos consultável; não há entrega HTTP externa configurada por este contrato.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ]
      }
    },
    "/api/v1/invitations": {
      "get": {
        "summary": "Listar convites pendentes da empresa",
        "operationId": "listAccountInvitations",
        "responses": {
          "200": {
            "description": "Listar convites pendentes da empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantInvitationPage"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Convidar usuário com papel permitido e MFA opcionalmente obrigatório",
        "operationId": "createAccountInvitation",
        "responses": {
          "201": {
            "description": "Convidar usuário com papel permitido e MFA opcionalmente obrigatório",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantInvitationCreated"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantInvitationInput"
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "delete": {
        "summary": "Revogar convite pendente da empresa",
        "operationId": "revokeAccountInvitation",
        "responses": {
          "200": {
            "description": "Revogar convite pendente da empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Revoked"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/invitations/accept": {
      "post": {
        "summary": "Aceitar convite de uso único",
        "operationId": "acceptAccountInvitation",
        "responses": {
          "200": {
            "description": "Aceitar convite de uso único",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantInvitationAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Erro estável, sem dados sensíveis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem exata configurada no painel; mutação com cookie exige proteção CSRF."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantInvitationAccept"
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/acs-settings": {
      "get": {
        "operationId": "getAcsSettings",
        "summary": "Consultar configuração da empresa",
        "x-permission": "acs:read",
        "responses": {
          "200": {
            "description": "Configuração sem senhas",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcsSettings"
                }
              }
            }
          },
          "401": {
            "description": "Erro público sem segredo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Erro público sem segredo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "saveAcsSettings",
        "summary": "Salvar configuração ACS e autenticação reversa",
        "x-permission": "acs:manage",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Origem do painel configurada no servidor."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcsSettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Configuração sem senhas",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcsSettings"
                }
              }
            }
          },
          "401": {
            "description": "Erro público sem segredo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Erro público sem segredo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Erro público sem segredo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Erro público sem segredo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Erro público sem segredo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Erro público sem segredo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-permissions-when-enabled": [
          "acs:manage",
          "tasks:execute"
        ]
      }
    },
    "/api/v1/acs-settings/provisioning": {
      "get": {
        "operationId": "getConnectionProvisioningStatus",
        "summary": "Acompanhar autenticação reversa por ONT",
        "x-permissions": [
          "acs:read",
          "devices:read"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Estado por ONT sem segredo; READY pode indicar endpoint sem desafio, explicitado em message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionProvisioningStatus"
                }
              }
            }
          },
          "401": {
            "description": "Sessão ausente"
          },
          "403": {
            "description": "Permissão insuficiente"
          },
          "422": {
            "description": "Página inválida"
          }
        }
      }
    },
    "/api/v1/devices/{deviceId}/wan/collect": {
      "post": {
        "summary": "Atualizar somente leitura WAN descoberta e vencida",
        "description": "Requer devices:read, tasks:execute e tasks:read. Tenant obrigatório no backend. Apenas GPV; sem alteração de configuração. CPE online. Reutiliza leitura pendente, bloqueia outra tarefa ativa e limita tentativas a 15 minutos. 202 não significa leitura aplicada; acompanhar taskIds.",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "taskIds, reused e skipped opcional (CURRENT_READING, RECENT_COLLECTION, DEVICE_BUSY)"
          },
          "403": {
            "description": "Sem permissão"
          },
          "404": {
            "description": "CPE não encontrada no tenant"
          },
          "409": {
            "description": "CPE offline ou WAN não descoberta"
          },
          "502": {
            "description": "Falha de entrega imediata"
          }
        }
      }
    },
    "/api/v1/devices/{deviceId}/telemetry/collect": {
      "post": {
        "summary": "Atualizar telemetria conhecida e vencida da CPE",
        "description": "Requer devices:read, tasks:execute e tasks:read. Tenant obrigatório no backend. Apenas GPV; sem alteração de configuração. CPE online. Reutiliza leitura pendente, bloqueia outra tarefa ativa e limita tentativas a 15 minutos. 202 não significa leitura aplicada; acompanhar taskIds. Inclui métricas ópticas, CPU, memória, uptime, estado WAN e contadores da interface vinculada. Apenas parâmetros com evidência do firmware atual; nenhuma credencial é consultada. A ausência de suporte não é convertida em zero.",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "taskIds, reused e skipped opcional (CURRENT_READING, RECENT_COLLECTION, DEVICE_BUSY)"
          },
          "403": {
            "description": "Sem permissão"
          },
          "404": {
            "description": "CPE não encontrada no tenant"
          },
          "409": {
            "description": "CPE offline ou WAN não descoberta"
          },
          "502": {
            "description": "Falha de entrega imediata"
          }
        }
      }
    },
    "/api/v1/wifi-profiles": {
      "get": {
        "operationId": "listCpeProfiles",
        "description": "provisioning:read; somente tenant autenticado. Lista existente sem paginação.",
        "responses": {
          "200": {
            "description": "Perfis e política persistida",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Profile"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Autenticação necessária"
          },
          "403": {
            "description": "Sem permissão ou origem inválida"
          }
        }
      },
      "post": {
        "operationId": "createCpeProfile",
        "description": "provisioning:write; tenant vem da sessão. Firmware IDs exigem firmware:approve.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Perfil criado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "400": {
            "description": "Campo inválido; CPE_PROFILE_COMPATIBILITY_INVALID ou CPE_PROFILE_COMPATIBILITY_FIRMWARE_REQUIRED"
          },
          "401": {
            "description": "Autenticação necessária"
          },
          "403": {
            "description": "Sem permissão ou origem inválida"
          },
          "409": {
            "description": "Nome/identidade/versões duplicados ou vínculo de firmware exige revalidação"
          }
        }
      }
    },
    "/api/v1/wifi-profiles/{profileId}": {
      "parameters": [
        {
          "name": "profileId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "put": {
        "operationId": "updateCpeProfile",
        "description": "provisioning:write; registra revisão e auditoria; sem mudança direta na ONT. Política vale no próximo despacho e seleção. Sem upgrade automático.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Perfil atualizado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "400": {
            "description": "Campo inválido; CPE_PROFILE_COMPATIBILITY_INVALID ou CPE_PROFILE_COMPATIBILITY_FIRMWARE_REQUIRED"
          },
          "401": {
            "description": "Autenticação necessária"
          },
          "403": {
            "description": "Sem permissão ou origem inválida"
          },
          "404": {
            "description": "Perfil ausente no tenant autenticado"
          },
          "409": {
            "description": "Nome/identidade/versões duplicados ou vínculo de firmware exige revalidação"
          }
        }
      }
    },
    "/api/v1/customers": {
      "get": {
        "summary": "Consulta no escopo da empresa com minimização de totais comerciais",
        "x-required-permission": "customers:read",
        "responses": {
          "200": {
            "description": "Totais só para proprietário/administrador com customers:read; campos restritos são null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerList"
                }
              }
            }
          },
          "401": {
            "description": "Sessão ausente"
          },
          "403": {
            "description": "Permissão insuficiente"
          }
        }
      }
    },
    "/api/v1/customer-cpe-inventory": {
      "get": {
        "summary": "Consulta no escopo da empresa com minimização de totais comerciais",
        "x-required-permission": "customers:read",
        "responses": {
          "200": {
            "description": "Totais só para proprietário/administrador com customers:read; campos restritos são null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerInventory"
                }
              }
            }
          },
          "401": {
            "description": "Sessão ausente"
          },
          "403": {
            "description": "Permissão insuficiente"
          }
        }
      }
    },
    "/api/v1/integrations/hubsoft": {
      "get": {
        "summary": "Consulta no escopo da empresa com minimização de totais comerciais",
        "x-required-permission": "integrations:read",
        "responses": {
          "200": {
            "description": "Totais só para proprietário/administrador com customers:read; campos restritos são null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationStatus"
                }
              }
            }
          },
          "401": {
            "description": "Sessão ausente"
          },
          "403": {
            "description": "Permissão insuficiente"
          }
        }
      }
    },
    "/api/v1/dashboard": {
      "get": {
        "operationId": "readDashboard",
        "description": "Exige devices:read e tenant da sessão. Sem period mantém contrato legado. Com period acrescenta readings. Não envia RPC à CPE. Hosts atuais limitados a 500 snapshots válidos, com cobertura explícita; null significa ausência de evidência. Histórico mede comunicação CWMP em janelas de 15 minutos, não hosts nem PPPoE.",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1H",
                "6H",
                "24H",
                "7D",
                "30D"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resumo existente e leituras opcionais",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "online": {
                      "type": "integer"
                    },
                    "offline": {
                      "type": "integer"
                    },
                    "readings": {
                      "type": "object",
                      "required": [
                        "generatedAt",
                        "period",
                        "source",
                        "windowMinutes",
                        "connected",
                        "history",
                        "historyNote"
                      ],
                      "properties": {
                        "generatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "period": {
                          "type": "string",
                          "enum": [
                            "1H",
                            "6H",
                            "24H",
                            "7D",
                            "30D"
                          ]
                        },
                        "source": {
                          "type": "string",
                          "const": "ACS_CWMP_SESSIONS"
                        },
                        "windowMinutes": {
                          "type": "integer",
                          "const": 15
                        },
                        "historyNote": {
                          "type": "string"
                        },
                        "connected": {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "coveredCpes": {
                              "type": "integer"
                            },
                            "totalCpes": {
                              "type": "integer"
                            },
                            "evaluatedCpes": {
                              "type": "integer"
                            },
                            "complete": {
                              "type": "boolean"
                            },
                            "observedAt": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "format": "date-time"
                            },
                            "source": {
                              "type": "string"
                            },
                            "historyAvailable": {
                              "type": "boolean",
                              "const": false
                            }
                          }
                        },
                        "history": {
                          "type": "array",
                          "maxItems": 61,
                          "items": {
                            "type": "object",
                            "properties": {
                              "at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "online": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "total": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Período inválido"
          },
          "401": {
            "description": "Sessão ausente"
          },
          "403": {
            "description": "devices:read ausente"
          }
        }
      }
    },
    "/api/v1/global-search": {
      "get": {
        "operationId": "searchOperationalResources",
        "description": "Busca existente, tenant-scoped, exige customers:read. Amplia correspondência por fabricante, modelo e MAC. Endereços IP e endpoints de gerência só participam com device_web:view. Parâmetros de senha nunca são pesquisados ou devolvidos.",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agrupamentos existentes de clientes, serviços e CPEs"
          },
          "401": {
            "description": "Sem sessão"
          },
          "403": {
            "description": "Sem permissão"
          }
        }
      }
    },
    "/api/v1/devices": {
      "get": {
        "operationId": "listDashboardDevices",
        "description": "Lista existente exige devices:read, limitada e tenant-scoped. Acrescenta management_address nullable apenas com device_web:view, proveniente de endpoint OBSERVED ou CONFIRMED do mesmo tenant/device. Demais campos preservados.",
        "responses": {
          "200": {
            "description": "Lista existente com endereço de gerência opcional"
          },
          "401": {
            "description": "Sem sessão"
          },
          "403": {
            "description": "Sem permissão"
          }
        }
      }
    },
    "/integrations/v1/me": {
      "get": {
        "tags": [
          "Credencial"
        ],
        "summary": "Confere a chave",
        "description": "Serve de teste de conexão. Vale para qualquer chave válida.",
        "operationId": "integrationMe",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Chave válida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationMe"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/devices/lookup": {
      "post": {
        "tags": [
          "Localização"
        ],
        "summary": "Localiza o equipamento por serviço, serial ou MAC",
        "description": "Escopo devices:read. Os identificadores vão no corpo para não ficarem em log de acesso. O serial GPON aceita as duas codificações (54504C475136E0B0 e TPLG5136e0b0). MAC e PPPoE ajudam a achar o candidato, mas sozinhos não liberam ação remota. Nunca há busca por nome.",
        "operationId": "lookupDevice",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationTarget"
              },
              "example": {
                "provider": "HUBSOFT",
                "serviceExternalId": "12345",
                "physicalIdentifier": "TPLG5136e0b0"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resultado da localização. Sem vínculo também responde 200, com link.state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationLookupResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/device-links": {
      "post": {
        "tags": [
          "Localização"
        ],
        "summary": "Confirma o vínculo por uma pessoa autorizada",
        "description": "Escopo devices:link, que nenhuma chave deve receber sem necessidade. Só promove candidato devolvido pela localização (UNCONFIRMED ou AMBIGUOUS). Divergência entre ERP e ACS nunca é resolvida aqui: responde 409 e pede revisão no painel.",
        "operationId": "confirmDeviceLink",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationLinkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Vínculo confirmado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationLinkResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/devices/{deviceId}/summary": {
      "get": {
        "tags": [
          "Leitura"
        ],
        "summary": "Resumo operacional",
        "description": "Escopo devices:read. Devolve a última leitura guardada no ACS, sem abrir sessão com o equipamento. live é sempre false e stale indica leitura obsoleta. Sem senha, sem IP e sem caminho de parâmetro.",
        "operationId": "deviceSummary",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/DeviceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Resumo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/devices/{deviceId}/connected-devices": {
      "get": {
        "tags": [
          "Leitura"
        ],
        "summary": "Dispositivos conectados",
        "description": "Escopo devices:read. MAC mascarado, sem nome de host nem IP do cliente.",
        "operationId": "deviceConnectedDevices",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/DeviceId"
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationConnectedDevices"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/devices/{deviceId}/reboot": {
      "post": {
        "tags": [
          "Ações"
        ],
        "summary": "Reinicia o equipamento",
        "description": "Escopo devices:reboot. Exige vínculo confirmado no momento do pedido. Sucesso da tarefa só com Inform de boot. Há intervalo mínimo entre reinícios (padrão 10 min), que conta tarefa de qualquer origem e boot sem tarefa. Derruba a internet do cliente por alguns minutos.",
        "operationId": "rebootDevice",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/DeviceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationActionRequest"
              },
              "example": {
                "target": {
                  "provider": "HUBSOFT",
                  "serviceExternalId": "12345",
                  "physicalIdentifier": "TPLG5136e0b0"
                },
                "actor": {
                  "type": "USER",
                  "id": "42",
                  "name": "Atendente"
                },
                "externalRef": "ticket:1001"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Repetição com a mesma Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationTask"
                }
              }
            }
          },
          "202": {
            "description": "Aceito. Ainda não aplicado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationTask"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/devices/{deviceId}/wifi": {
      "post": {
        "tags": [
          "Ações"
        ],
        "summary": "Troca senha ou nome da rede",
        "description": "Escopo wifi:write. Exige vínculo confirmado e perfil homologado. A senha nunca volta na resposta nem fica em auditoria. Em alguns modelos a alteração só vale depois de reiniciar (AWAITING_REBOOT) e a senha não pode ser relida (UNCONFIRMED com reason PASSWORD_NOT_READABLE): isso não é falha.\n\nDesde 2026-11-09 a entrega não exige mais que o ACS alcance o equipamento agora. `delivery` diz como a alteração vai chegar: `IMMEDIATE` quando o Connection Request foi aceito, `NEXT_INFORM` quando o aparelho está inalcançável de fora e a tarefa ficou na fila do próximo contato dele (o caso típico de CGNAT). Antes dessa data o mesmo cenário respondia 409 IMMEDIATE_DELIVERY_FAILED e a tarefa era encerrada sem nada chegar ao equipamento. Acompanhe por GET /integrations/v1/tasks/{taskId} nos dois casos.\n\nO template homologado trata uma rede por banda. Aparelho que anuncia outras redes mantém o nome antigo nelas, e isso não é falha da troca.",
        "operationId": "changeDeviceWifi",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/DeviceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationWifiRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Repetição com a mesma Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationTask"
                }
              }
            }
          },
          "202": {
            "description": "Aceito. Ainda não aplicado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationTask"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/devices/{deviceId}/refresh": {
      "post": {
        "tags": [
          "Ações"
        ],
        "summary": "Pede uma leitura nova",
        "description": "Escopo devices:refresh. Abre sessão com o equipamento, por isso tem limite: tarefa ativa é reaproveitada e a leitura repete no máximo a cada 15 min (skipped informa o motivo).",
        "operationId": "refreshDeviceReading",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/DeviceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationRefreshRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Pedido aceito ou reaproveitado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationRefreshResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/tasks/{taskId}": {
      "get": {
        "tags": [
          "Tarefas"
        ],
        "summary": "Consulta o estado de uma ação",
        "description": "Escopo tasks:read. Só tarefas criadas por esta API. ACCEPTED: aceita pelo ACS. SENT: enviada ao equipamento. AWAITING_REBOOT: equipamento aceitou e só aplica depois de reiniciar. CONFIRMED: confirmada pelo equipamento. UNCONFIRMED: sem confirmação, veja reason. FAILED: falhou. EXPIRED: expirou sem chegar ao equipamento.",
        "operationId": "integrationTask",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Estado atual",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationTask"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/devices/{deviceId}/wifi-channels": {
      "get": {
        "tags": [
          "Leitura"
        ],
        "summary": "Análise de canais por banda",
        "operationId": "getDeviceWifiChannels",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/DeviceId"
          }
        ],
        "description": "Escopo devices:read. Última análise, sem nome de redes de terceiros. Modelo sem varredura responde scan.code CHANNEL_SCAN_UNSUPPORTED.",
        "responses": {
          "200": {
            "description": "Análise",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationChannelView"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/devices/{deviceId}/wifi-channels/scan": {
      "post": {
        "tags": [
          "Ações"
        ],
        "summary": "Pede uma varredura de canais",
        "operationId": "scanDeviceWifiChannels",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/DeviceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "description": "Escopo wifi:scan. Assíncrono. Uma varredura por vez. PREPARING significa que o pedido precisa ser repetido.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "actor",
                  "externalRef"
                ],
                "properties": {
                  "actor": {
                    "type": "object"
                  },
                  "externalRef": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Aceito",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationChannelScan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/devices/{deviceId}/wifi-channel": {
      "post": {
        "tags": [
          "Ações"
        ],
        "summary": "Troca o canal, liga o automático ou reverte",
        "operationId": "changeDeviceWifiChannel",
        "security": [
          {
            "integrationKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/DeviceId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "description": "Escopo wifi:channel. Exige vínculo confirmado, análise recente, homologação do canal para firmware e equipamento, canal permitido na banda e no Brasil. A troca desconecta os aparelhos: avise o cliente antes. Repetição com a mesma Idempotency-Key devolve a tarefa original. Uma reversão por troca: revert sobre reversão responde CHANNEL_REVERT_UNAVAILABLE. Erros: CHANNEL_SCAN_UNSUPPORTED, CHANNEL_CHANGE_TOO_SOON, CHANNEL_REVERT_UNAVAILABLE, WIFI_CHANNEL_NOT_ALLOWED, WIFI_CHANNEL_NOT_HOMOLOGATED, WIFI_CHANNEL_EVIDENCE_STALE.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationChannelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Repetição com a mesma Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationChannelChange"
                }
              }
            }
          },
          "202": {
            "description": "Aceito. Ainda não aplicado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationChannelChange"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Lista as assinaturas desta chave",
        "description": "Mostra apenas as assinaturas da propria chave. Um integrador nao enxerga a do outro, mesmo na mesma empresa. O segredo nunca volta aqui.",
        "operationId": "listIntegrationWebhooks",
        "security": [
          {
            "integrationKey": [
              "webhooks:manage"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Assinaturas",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookSubscription"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Assina eventos",
        "description": "Cadastra um destino HTTPS. O segredo de assinatura e devolvido UMA unica vez, nesta resposta, e nao aparece em listagem, log, auditoria nem neste contrato. Repetir o mesmo URL na mesma chave atualiza a assinatura e gera segredo novo: e o caminho de rotacao.\n\nCada entrega leva `X-Noori-Signature: t=<unix>,v1=<hmac-sha256 hex>`, calculado sobre a cadeia `<t>.<corpo>` com o segredo. O carimbo entra no que e assinado para que uma entrega antiga reapresentada nao passe; recuse `t` fora de 300 s.\n\nEntrega repetida e possivel. Trate `id` do corpo (igual a `X-Noori-Delivery`) como chave de idempotencia.\n\nResponda 2xx para confirmar. 4xx que nao seja 408 ou 429 e tratado como recusa definitiva e nao e repetido. Falha de rede e 5xx sao repetidos com recuo de 1, 2, 4, 8, 16 e 30 minutos, ate 6 tentativas. Vinte falhas seguidas desligam a assinatura.",
        "operationId": "createIntegrationWebhook",
        "security": [
          {
            "integrationKey": [
              "webhooks:manage"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "events"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://chat.example.com/noori/acs"
                  },
                  "events": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "task.completed",
                        "device.online",
                        "device.offline"
                      ]
                    }
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 200,
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Assinada. O segredo aparece so agora.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook": {
                      "$ref": "#/components/schemas/WebhookSubscription"
                    },
                    "secret": {
                      "type": "string",
                      "description": "Guarde: nao e possivel recuperar depois."
                    },
                    "signature": {
                      "type": "object",
                      "properties": {
                        "header": {
                          "type": "string"
                        },
                        "format": {
                          "type": "string"
                        },
                        "toleranceSeconds": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/integrations/v1/webhooks/{webhookId}": {
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Cancela a assinatura",
        "description": "Remove a assinatura e a fila pendente dela. So alcanca assinatura da propria chave.",
        "operationId": "deleteIntegrationWebhook",
        "security": [
          {
            "integrationKey": [
              "webhooks:manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/customers/services/{serviceId}/clear-mac": {
      "post": {
        "operationId": "requestHubsoftMacClear",
        "summary": "Solicita limpeza exclusiva do MAC de autenticação do serviço",
        "description": "Exige integrations:sessions:resolve, Origin igual ao APP_ORIGIN e macResetEnabled na integração do tenant. Valida vínculo vigente da CPE. Não altera endereço físico Layer2. Mesma chave retorna a mesma operação; uma operação pendente/incerta bloqueia novas solicitações.",
        "parameters": [
          {
            "in": "path",
            "name": "serviceId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "deviceId"
                ],
                "properties": {
                  "deviceId": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Operação persistida; somente SUCCESS comprova confirmação do HubSoft.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MacOperation"
                }
              }
            }
          },
          "401": {
            "description": "Sessão ausente"
          },
          "403": {
            "description": "Permissão ou origem recusada"
          },
          "409": {
            "description": "Integração desativada, associação inválida ou conflito de operação/chave"
          },
          "422": {
            "description": "deviceId ou Idempotency-Key inválidos"
          }
        }
      }
    },
    "/api/v1/customers/mac-operations/{id}": {
      "get": {
        "operationId": "getHubsoftMacClear",
        "summary": "Consulta resultado da operação no tenant autenticado",
        "description": "Exige integrations:sessions:resolve. UNKNOWN exige reconciliação antes de nova limpeza; não há reenvio automático.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação persistida; somente SUCCESS comprova confirmação do HubSoft.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MacOperation"
                }
              }
            }
          },
          "401": {
            "description": "Sessão ausente"
          },
          "403": {
            "description": "Permissão recusada"
          },
          "404": {
            "description": "Operação não pertence ao tenant ou não existe"
          }
        }
      }
    },
    "/api/v1/integration-center": {
      "get": {
        "operationId": "listIntegrationCenter",
        "summary": "Lista unificada dos conectores da empresa",
        "responses": {
          "200": {
            "description": "Conectores, empresa, catálogo de escopos e a árvore de capacidades.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CenterList"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/api/v1/integration-center/{kind}/{id}/test": {
      "post": {
        "operationId": "testIntegration",
        "summary": "Verificação real do conector, em 7 passos",
        "description": "Executa a verificação na hora e guarda o resultado em `integration_health_checks`, que alimenta as colunas de última verificação e tempo de resposta da lista.\n\nPassos: conectividade, disponibilidade da API, credenciais, escopos, consulta real somente de leitura, tempo de resposta e compatibilidade das funcionalidades.\n\nNenhum passo altera equipamento nem envia evento de webhook: o retorno por webhook é conferido só por resolução de destino.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Kind"
          },
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado da verificação.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResult"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/integration-center/{kind}/{id}/logs": {
      "get": {
        "operationId": "listIntegrationLogs",
        "summary": "Verificações e auditoria do conector",
        "parameters": [
          {
            "$ref": "#/components/parameters/Kind"
          },
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Histórico em ordem decrescente de tempo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Logs"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/integration-center/{kind}/{id}/monitor": {
      "get": {
        "operationId": "getIntegrationMonitor",
        "summary": "Configuração e estado da vigilância automática",
        "parameters": [
          {
            "$ref": "#/components/parameters/Kind"
          },
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Monitor atual, ou `null` quando o conector ainda não é vigiado.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "monitor": {
                      "$ref": "#/components/schemas/Monitor"
                    },
                    "intervals": {
                      "type": "array",
                      "items": {
                        "enum": [
                          1,
                          5,
                          10,
                          15,
                          30
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "operationId": "setIntegrationMonitor",
        "summary": "Liga, desliga e ajusta a vigilância automática",
        "description": "A verificação roda no servidor, sem ninguém com o painel aberto, e usa exatamente a mesma rotina do teste manual.\n\nDesligar zera o incidente aberto: ninguém recebe “restabelecida” de algo que parou de ser vigiado.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Kind"
          },
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MonitorInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Monitor gravado.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "monitor": {
                      "$ref": "#/components/schemas/Monitor"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/integration-center/{kind}/{id}/alerts": {
      "get": {
        "operationId": "listIntegrationAlerts",
        "summary": "Histórico de alertas do conector",
        "parameters": [
          {
            "$ref": "#/components/parameters/Kind"
          },
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Alertas em ordem decrescente de tempo.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Alert"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/api/v1/integration-center/alert-settings": {
      "get": {
        "operationId": "getAlertSettings",
        "summary": "Canal de alerta da empresa, meus telefones e minhas preferências",
        "description": "O canal é da empresa e exige `integrations:manage` para alterar. Telefones e preferências são sempre do usuário autenticado: o `user_id` vem da sessão, nunca do corpo.",
        "responses": {
          "200": {
            "description": "Estado atual.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSettings"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "setAlertSettings",
        "summary": "Grava canal, telefones e preferências",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "channel": {
                    "$ref": "#/components/schemas/ChannelInput"
                  },
                  "phones": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "type": "object",
                      "required": [
                        "phone"
                      ],
                      "properties": {
                        "phone": {
                          "type": "string",
                          "description": "DDI e DDD, só dígitos ou com máscara — o servidor normaliza."
                        },
                        "label": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 40
                        }
                      }
                    }
                  },
                  "preferences": {
                    "type": "object",
                    "properties": {
                      "alerts": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Gravado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A configuração do canal mudou em outra aba."
          },
          "422": {
            "description": "Endereço, chave ou telefone inválido."
          }
        }
      }
    },
    "/api/v1/integration-center/alert-settings/test": {
      "post": {
        "operationId": "testAlertChannel",
        "summary": "Envia uma mensagem de teste pelo canal",
        "description": "Vai somente para o número de teste cadastrado na configuração, nunca para o telefone de um administrador: teste não é alerta.",
        "responses": {
          "200": {
            "description": "O HubOS aceitou a mensagem.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendOutcome"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Canal não configurado, ou sem número de teste."
          },
          "502": {
            "description": "O HubOS recusou ou não respondeu.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendOutcome"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration-center/keys/{id}": {
      "patch": {
        "operationId": "updateIntegrationKey",
        "summary": "Altera nome, funções, validade, origens liberadas e ativação",
        "description": "Campo ausente não é alterado. `expiresInDays: null` passa a validade indeterminada. `allowedCidrs: null` ou lista vazia volta a liberar qualquer origem. Chave revogada não é alterável: revogação é definitiva.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Chave alterada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyView"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Chave ativa não encontrada nesta empresa, ou a chave está revogada."
          }
        }
      },
      "delete": {
        "operationId": "deleteIntegrationKey",
        "summary": "Exclui a chave definitivamente",
        "description": "Apaga a chave e, em cascata, as assinaturas de webhook dela. Exige confirmação digitada com o nome exato do sistema. Para interromper o acesso preservando o registro, use a revogação em `/api/v1/integration-keys/{id}/revoke`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "confirm"
                ],
                "properties": {
                  "confirm": {
                    "type": "string",
                    "description": "Nome exato do sistema, como está cadastrado."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Excluída.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "const": true
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "webhooksRemoved": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Confirmação ausente ou diferente do nome cadastrado."
          }
        }
      }
    },
    "/api/v1/integration-center/keys/{id}/duplicate": {
      "post": {
        "operationId": "duplicateIntegrationKey",
        "summary": "Duplica a chave com um segredo novo",
        "description": "A cópia nasce com as mesmas funções, validade e origens liberadas, e um segredo novo — o segredo original não existe em lugar nenhum, só o hash. O segredo da cópia é devolvido uma única vez.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "integrator": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9 ._-]{2,64}$",
                    "description": "Nome da cópia. Omitido, recebe um nome derivado do original."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Cópia criada.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/KeyView"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "secret": {
                          "type": "string"
                        },
                        "secretShownOnce": {
                          "const": true
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/task-operations/firmware-plan": {
      "post": {
        "description": "Prévia sem criação de tasks. Tenant da sessão; exige tasks:execute e firmware:deploy. Satélites antes da principal. Pacote único compatível por satélite; seleção ambígua ou sem homologação retorna 409. Já atualizado é validado por versão homologada e Inform recente na execução.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "deviceIds",
                  "firmwareId"
                ],
                "properties": {
                  "deviceIds": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 200,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "firmwareId": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Plano revisável ou null quando não há descendentes Mesh.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meshPlan": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/MeshFirmwarePlan"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Seleção inválida ou dispositivo fora do tenant"
          },
          "401": {
            "description": "Sessão ausente"
          },
          "403": {
            "description": "Permissão insuficiente"
          },
          "409": {
            "description": "MESH_FIRMWARE_NOT_READY, MESH_TOPOLOGY_INVALID, MESH_SELECTION_OVERLAP, MESH_FIRMWARE_LIMIT"
          }
        }
      }
    },
    "/api/v1/task-operations": {
      "post": {
        "description": "Extensão aditiva do contrato existente: meshPlanHash obrigatório quando houver rede Mesh. Recalcula plano e rejeita hash divergente (409 MESH_PLAN_CONFIRMATION_REQUIRED). Idempotency-Key obrigatório. Reserva todos os alvos, revalida permissão/pacote/topologia por etapa e interrompe após falha. Satélites usam próximo Inform. Prazo escolhido ou 24h para imediato. Nenhuma atualização automática fora da operação confirmada.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "required": [
                      "deviceIds",
                      "firmwareId"
                    ],
                    "properties": {
                      "deviceIds": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 200,
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "firmwareId": {
                        "type": "string",
                        "format": "uuid"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "execution"
                    ],
                    "properties": {
                      "meshPlanHash": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "execution": {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "enum": [
                              "IMMEDIATE",
                              "SCHEDULED",
                              "NEXT_INFORM"
                            ]
                          },
                          "waitMinutes": {
                            "enum": [
                              15,
                              60,
                              1440
                            ]
                          },
                          "scheduledFor": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "timezone": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Progresso da operação existente acrescido de meshPlan"
          },
          "403": {
            "description": "Permissão insuficiente"
          },
          "409": {
            "description": "Plano divergente, equipamento reservado ou validação falhou"
          }
        }
      }
    },
    "/api/v1/task-operations/{id}/progress": {
      "get": {
        "description": "Exige tasks:read. Resposta de progresso existente inclui meshPlan; etapas aguardando predecessor usam WAITING_DEPENDENCY. SUCCESS exige versão confirmada; alreadyCurrent não cria Download.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Progresso e eventos da operação"
          },
          "404": {
            "description": "Operação inexistente neste tenant"
          }
        }
      }
    },
    "/api/v1/devices/{deviceId}": {
      "get": {
        "description": "Extensão da resposta existente autenticada e isolada por tenant. Dispositivo: MeshFields na raiz. Cliente: MeshFields em serviceGroups[].equipments[]. Permissões existentes preservadas.",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resposta existente acrescida de MeshFields"
          },
          "403": {
            "description": "Sem permissão"
          },
          "404": {
            "description": "Não encontrado no tenant"
          }
        }
      }
    },
    "/api/v1/customers/{customerId}": {
      "get": {
        "description": "Extensão da resposta existente autenticada e isolada por tenant. Dispositivo: MeshFields na raiz. Cliente: MeshFields em serviceGroups[].equipments[]. Permissões existentes preservadas.",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resposta existente acrescida de MeshFields"
          },
          "403": {
            "description": "Sem permissão"
          },
          "404": {
            "description": "Não encontrado no tenant"
          }
        }
      }
    },
    "/api/v1/devices/{deviceId}/connected-devices/collect": {
      "post": {
        "description": "Coleta somente leitura. Satélite Mesh com vínculo ativo usa próximo Inform; ONT preserva entrega imediata. Tenant e RBAC no backend. Aceitação não confirma coleta concluída.",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Coleta aceita ou reutilizada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "taskIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "deliveryMode": {
                      "type": "string",
                      "enum": [
                        "NEXT_INFORM"
                      ],
                      "description": "Opcional; presente ao enfileirar nova leitura de satélite."
                    },
                    "reused": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão"
          },
          "404": {
            "description": "Dispositivo fora do tenant"
          },
          "409": {
            "description": "Estado incompatível com a coleta"
          }
        }
      }
    },
    "/api/v1/devices/{deviceId}/lan-ports/collect": {
      "post": {
        "description": "Coleta somente leitura. Satélite Mesh com vínculo ativo usa próximo Inform; ONT preserva entrega imediata. Tenant e RBAC no backend. Aceitação não confirma coleta concluída.",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Coleta aceita ou reutilizada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "taskIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "deliveryMode": {
                      "type": "string",
                      "enum": [
                        "NEXT_INFORM"
                      ],
                      "description": "Opcional; presente ao enfileirar nova leitura de satélite."
                    },
                    "reused": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão"
          },
          "404": {
            "description": "Dispositivo fora do tenant"
          },
          "409": {
            "description": "Estado incompatível com a coleta"
          }
        }
      }
    },
    "/api/v1/operations/availability": {
      "get": {
        "summary": "Disponibilidade das flags da empresa",
        "operationId": "get_api_v1_operations_availability",
        "x-permission": "operations_tasks.view",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tasks": {
                      "type": "boolean"
                    },
                    "workflows": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "tasks",
                    "workflows"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/catalog": {
      "get": {
        "summary": "Opções operacionais e responsáveis ativos",
        "operationId": "get_api_v1_operations_catalog",
        "x-permission": "operations_tasks.view",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statuses": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "priorities": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "workflows": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Workflow"
                      }
                    }
                  },
                  "required": [
                    "statuses",
                    "priorities",
                    "types",
                    "workflows"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/resources": {
      "get": {
        "summary": "Pesquisar recursos permitidos desta empresa",
        "operationId": "get_api_v1_operations_resources",
        "x-permission": "operations_tasks.view",
        "parameters": [
          {
            "in": "query",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "CUSTOMER",
                "SERVICE",
                "DEVICE",
                "CAMPAIGN",
                "FIRMWARE",
                "BACKUP",
                "PROFILE",
                "FAULT",
                "DIAGNOSTIC",
                "DEVICE_TASK",
                "WORKFLOW"
              ]
            }
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string",
              "maxLength": 180
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks": {
      "get": {
        "summary": "Listar tarefas sem totais comerciais",
        "operationId": "get_api_v1_operations_tasks",
        "x-permission": "operations_tasks.view",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "queue",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "priority",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userId",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "teamId",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workflowId",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customerId",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceId",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "deviceId",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dueFrom",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "dueTo",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskPage"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Criar trabalho humano, sem executar RPC",
        "operationId": "post_api_v1_operations_tasks",
        "x-permission": "operations_tasks.create",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskCreate"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}": {
      "get": {
        "summary": "Consultar tarefa e histórico",
        "operationId": "get_api_v1_operations_tasks__taskId_",
        "x-permission": "operations_tasks.view",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Task"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "checklist": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "comments": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "attachments": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "resources": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "watchers": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      },
                      "required": []
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Editar tarefa com versão esperada",
        "operationId": "put_api_v1_operations_tasks__taskId_",
        "x-permission": "operations_tasks.update",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}/assign": {
      "post": {
        "summary": "Operação humana: assign",
        "operationId": "post_api_v1_operations_tasks__taskId__assign",
        "x-permission": "operations_tasks.assign",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}/claim": {
      "post": {
        "summary": "Operação humana: claim",
        "operationId": "post_api_v1_operations_tasks__taskId__claim",
        "x-permission": "operations_tasks.update",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}/watchers": {
      "post": {
        "summary": "Operação humana: watchers",
        "operationId": "post_api_v1_operations_tasks__taskId__watchers",
        "x-permission": "operations_tasks.assign",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}/start": {
      "post": {
        "summary": "Operação humana: start",
        "operationId": "post_api_v1_operations_tasks__taskId__start",
        "x-permission": "operations_tasks.update",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}/complete": {
      "post": {
        "summary": "Operação humana: complete",
        "operationId": "post_api_v1_operations_tasks__taskId__complete",
        "x-permission": "operations_tasks.complete",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}/cancel": {
      "post": {
        "summary": "Operação humana: cancel",
        "operationId": "post_api_v1_operations_tasks__taskId__cancel",
        "x-permission": "operations_tasks.cancel",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}/transition": {
      "post": {
        "summary": "Operação humana: transition",
        "operationId": "post_api_v1_operations_tasks__taskId__transition",
        "x-permission": "operations_tasks.update",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}/comments": {
      "post": {
        "summary": "Operação humana: comments",
        "operationId": "post_api_v1_operations_tasks__taskId__comments",
        "x-permission": "operations_tasks.comment",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}/checklist": {
      "post": {
        "summary": "Operação humana: checklist",
        "operationId": "post_api_v1_operations_tasks__taskId__checklist",
        "x-permission": "operations_tasks.update",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}/resources": {
      "post": {
        "summary": "Operação humana: resources",
        "operationId": "post_api_v1_operations_tasks__taskId__resources",
        "x-permission": "operations_tasks.update",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{taskId}/attachments": {
      "post": {
        "summary": "Anexar arquivo conferido, até 5 MB",
        "operationId": "post_api_v1_operations_tasks__taskId__attachments",
        "x-permission": "operations_tasks.attach",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          },
          {
            "in": "header",
            "name": "X-Filename",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Sanitized-Confirmation",
            "required": true,
            "schema": {
              "enum": [
                "true"
              ]
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attachment"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "text/plain": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/attachments/{attachmentId}": {
      "get": {
        "summary": "Baixar anexo autorizado",
        "operationId": "get_api_v1_operations_attachments__attachmentId_",
        "x-permission": "operations_tasks.attach",
        "parameters": [
          {
            "in": "path",
            "name": "attachmentId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows": {
      "get": {
        "summary": "Listar definições de fluxo",
        "operationId": "get_api_v1_workflows",
        "x-permission": "workflows.view",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Workflow"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Criar definição de fluxo",
        "operationId": "post_api_v1_workflows",
        "x-permission": "workflows.manage",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workflow"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowInput"
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}": {
      "put": {
        "summary": "Editar definição ainda sem instâncias",
        "operationId": "put_api_v1_workflows__workflowId_",
        "x-permission": "workflows.manage",
        "parameters": [
          {
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workflow"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowInput"
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/defaults": {
      "post": {
        "summary": "Instalar os seis fluxos padrão uma vez",
        "operationId": "post_api_v1_workflows_defaults",
        "x-permission": "workflows.manage",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "installed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "installed"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/board": {
      "get": {
        "summary": "Consultar quadro paginado",
        "operationId": "get_api_v1_workflows__workflowId__board",
        "x-permission": "workflows.view",
        "parameters": [
          {
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskPage"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/rules": {
      "get": {
        "summary": "Consultar ou configurar regras de acompanhamento",
        "operationId": "get_api_v1_workflows__workflowId__rules",
        "x-permission": "workflows.manage",
        "parameters": [
          {
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Rule"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Consultar ou configurar regras de acompanhamento",
        "operationId": "post_api_v1_workflows__workflowId__rules",
        "x-permission": "workflows.manage",
        "parameters": [
          {
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleInput"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/teams": {
      "get": {
        "summary": "Consultar equipes e membros",
        "operationId": "get_api_v1_operations_teams",
        "x-permission": "operations_tasks.manage_team",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Team"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Criar equipe",
        "operationId": "post_api_v1_operations_teams",
        "x-permission": "operations_tasks.manage_team",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Team"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamInput"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/teams/{teamId}": {
      "put": {
        "summary": "Editar equipe com versão",
        "operationId": "put_api_v1_operations_teams__teamId_",
        "x-permission": "operations_tasks.manage_team",
        "parameters": [
          {
            "in": "path",
            "name": "teamId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Team"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamInput"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/notifications": {
      "get": {
        "summary": "Consultar notificações do próprio usuário",
        "operationId": "get_api_v1_operations_notifications",
        "x-permission": "operations_tasks.view",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "task_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "read_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "task_id",
                          "kind"
                        ]
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/notifications/{notificationId}/read": {
      "post": {
        "summary": "Marcar própria notificação como lida",
        "operationId": "post_api_v1_operations_notifications__notificationId__read",
        "x-permission": "operations_tasks.view",
        "parameters": [
          {
            "in": "path",
            "name": "notificationId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflow-items": {
      "post": {
        "summary": "Criar trabalho humano, sem executar RPC",
        "operationId": "createWorkflowItem",
        "x-permission": "operations_tasks.create",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskCreate"
              }
            }
          }
        }
      }
    },
    "/api/v1/workflow-items/{taskId}": {
      "get": {
        "summary": "Consultar tarefa e histórico",
        "operationId": "getWorkflowItem",
        "x-permission": "operations_tasks.view",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Task"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "checklist": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "comments": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "attachments": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "resources": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "watchers": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      },
                      "required": []
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Editar tarefa com versão esperada",
        "operationId": "putWorkflowItem",
        "x-permission": "operations_tasks.update",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/workflow-items/{taskId}/transition": {
      "post": {
        "summary": "Operação humana: transition",
        "operationId": "transitionWorkflowItem",
        "x-permission": "operations_tasks.update",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação concluída",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permissão ou flag bloqueada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso ausente nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Concorrência, repetição ou evidência insuficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Vínculo ou transição incompatível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Falha operacional sanitizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMutation"
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/tasks/{id}/backups": {
      "post": {
        "summary": "Registrar exportação manual cifrada",
        "x-permissions": [
          "operations_backups.write"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Filename",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Operação realizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManualBackup"
                }
              }
            }
          },
          "400": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 5242880
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/backups/{id}": {
      "get": {
        "summary": "Consultar metadados",
        "x-permissions": [
          "operations_backups.read"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação realizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManualBackup"
                }
              }
            }
          },
          "400": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/backups/{id}/download": {
      "get": {
        "summary": "Download privilegiado com verificação de integridade",
        "x-permissions": [
          "operations_backups.read"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação realizada",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/backups/{id}/validate": {
      "post": {
        "summary": "Registrar conferência manual",
        "x-permissions": [
          "operations_backups.validate"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operação realizada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManualBackup"
                }
              }
            }
          },
          "400": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Erro de validação, autorização ou concorrência",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "version",
                  "status",
                  "note",
                  "manualConfirmation"
                ],
                "properties": {
                  "version": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "status": {
                    "enum": [
                      "VALIDATED",
                      "REJECTED"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "manualConfirmation": {
                    "const": true
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/v1/tenant-accounts": {
      "post": {
        "operationId": "provisionTenantAccount",
        "summary": "Gera uma conta isolada já operando",
        "description": "Em UMA transação: empresa, endpoint CWMP, credencial CWMP própria, papéis, assinatura e convite do proprietário. Ou sai tudo, ou nada. O estado inicial vem do tipo do plano: TRIAL nasce com prazo; PAID e COURTESY nascem ACTIVE. Exige platform:tenants:manage, platform:users:manage e platform:plans:manage, porque faz o trabalho das três rotas avulsas. A senha CWMP é devolvida UMA vez, aqui; depois só é possível trocá-la.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "tenant",
                  "planVersionId",
                  "ownerEmail"
                ],
                "properties": {
                  "tenant": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "slug",
                      "name"
                    ],
                    "properties": {
                      "slug": {
                        "type": "string",
                        "pattern": "^[a-z0-9][a-z0-9-]{1,62}$",
                        "description": "Vira o endpoint CWMP da empresa."
                      },
                      "name": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 160
                      },
                      "legalName": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 200
                      },
                      "taxDocument": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 32
                      },
                      "billingEmail": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "email"
                      },
                      "timezone": {
                        "type": "string",
                        "description": "Fuso IANA reconhecido pelo runtime; decide dia de vencimento e janela de agendamento."
                      },
                      "deploymentMode": {
                        "type": "string",
                        "enum": [
                          "CLOUD_SAAS",
                          "SELF_HOSTED"
                        ]
                      },
                      "releaseChannel": {
                        "type": "string",
                        "enum": [
                          "STABLE",
                          "BETA",
                          "PILOT",
                          "INTERNAL",
                          "FROZEN"
                        ],
                        "description": "Diferente de STABLE exige platform:releases:manage."
                      },
                      "environment": {
                        "type": "string",
                        "enum": [
                          "LAB",
                          "HOMOLOGATION",
                          "PRODUCTION"
                        ]
                      }
                    }
                  },
                  "planVersionId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Versão vigente de um plano ativo."
                  },
                  "ownerEmail": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Conta criada e operando.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "object"
                    },
                    "subscription": {
                      "type": "object"
                    },
                    "invitation": {
                      "type": "object",
                      "description": "Inclui inviteUrl, exibido uma vez."
                    },
                    "plan": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "PAID",
                            "TRIAL",
                            "COURTESY"
                          ]
                        },
                        "trialDays": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "maxDevices": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      }
                    },
                    "trialEndsAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "cwmp": {
                      "type": "object",
                      "description": "Credencial CWMP da empresa. Devolvida UMA vez. Não volta em nenhuma leitura posterior e não aparece em log ou auditoria.",
                      "properties": {
                        "endpoint": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "password": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida: PROVISIONING_INPUT_INVALID, PROVISIONING_FIELDS_INVALID, TENANT_SLUG_INVALID, TIMEZONE_INVALID, PLAN_VERSION_INVALID, OWNER_EMAIL_INVALID."
          },
          "403": {
            "description": "FORBIDDEN — o papel global não permite."
          },
          "404": {
            "description": "PLAN_VERSION_NOT_FOUND."
          },
          "409": {
            "description": "TENANT_SLUG_DUPLICATE, PLAN_NOT_ACTIVE, PLAN_VERSION_RETIRED, PLAN_VERSION_NOT_EFFECTIVE, PLAN_TRIAL_WITHOUT_DAYS, INVITATION_OWNER_EXISTS, TENANT_LIMIT_MAX_USERS."
          }
        }
      }
    },
    "/api/platform/v1/capacity": {
      "get": {
        "operationId": "readCapacity",
        "summary": "O que o servidor atende, o que foi vendido e o que foi medido",
        "description": "Três grandezas separadas: em uso é contagem; vendido é a soma dos limites dos planos das assinaturas vigentes; suportado é medido por teste de estresse ou declarado em NOORIACS_CAPACITY_MAX_DEVICES. Suportado em aparelhos = vazão medida x intervalo de Inform observado na frota (mediana). Sem medição e sem declaração, suportado vem nulo com origem NAO_MEDIDO. A empresa de carga fica fora de toda contagem. Exige platform:health:read.",
        "responses": {
          "200": {
            "description": "Leitura da capacidade.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ambiente": {
                      "type": "string",
                      "enum": [
                        "LAB",
                        "HOMOLOGATION",
                        "PRODUCTION"
                      ]
                    },
                    "emUso": {
                      "type": "object",
                      "properties": {
                        "aparelhos": {
                          "type": "integer"
                        },
                        "empresas": {
                          "type": "integer"
                        },
                        "empresasOperacionais": {
                          "type": "integer"
                        },
                        "sessoesAbertas": {
                          "type": "integer"
                        },
                        "informsUltimaHora": {
                          "type": "integer"
                        },
                        "informs24h": {
                          "type": "integer"
                        },
                        "picoInformsPorMinuto24h": {
                          "type": "integer"
                        }
                      }
                    },
                    "vendido": {
                      "type": "object",
                      "properties": {
                        "somaDosLimites": {
                          "type": "integer"
                        },
                        "assinaturasSemLimite": {
                          "type": "integer",
                          "description": "Contadas à parte: somá-las como zero esconderia o risco."
                        },
                        "assinaturasComLimite": {
                          "type": "integer"
                        }
                      }
                    },
                    "suportado": {
                      "type": "object",
                      "properties": {
                        "aparelhos": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "informsPorSegundo": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "informsPorMinuto": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "intervaloInformSegundos": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "origem": {
                          "type": "string",
                          "enum": [
                            "MEDIDO",
                            "DECLARADO",
                            "NAO_MEDIDO"
                          ]
                        },
                        "comoFoiObtido": {
                          "type": "string"
                        },
                        "medicao": {
                          "type": [
                            "object",
                            "null"
                          ]
                        }
                      }
                    },
                    "folga": {
                      "type": "object"
                    },
                    "porEmpresa": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "medicoes": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "FORBIDDEN."
          }
        }
      }
    },
    "/api/platform/v1/capacity/stress-tests": {
      "post": {
        "operationId": "runCapacityStressTest",
        "summary": "Mede a vazão real do caminho CWMP",
        "description": "Envia Informs CWMP autenticados por digest contra a PRÓPRIA aplicação, numa empresa dedicada sem assinatura, reusando uma frota sintética limitada. O alvo nunca vem da requisição: é lido de deviceOrigin/appOrigin. Em produção exige confirmProduction, porque a carga concorre com CPE de cliente. Exige platform:health:read e platform:tenants:manage.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "concurrency": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "default": 10
                  },
                  "planned": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 20000,
                    "default": 200
                  },
                  "confirmProduction": {
                    "type": "boolean",
                    "default": false
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 1000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Medição concluída e registrada.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "runId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "succeeded": {
                      "type": "integer"
                    },
                    "failed": {
                      "type": "integer"
                    },
                    "durationMs": {
                      "type": "integer"
                    },
                    "p50Ms": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "p95Ms": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "maxMs": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "informsPorSegundo": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "outcome": {
                      "type": "string",
                      "enum": [
                        "COMPLETED",
                        "ABORTED",
                        "FAILED"
                      ]
                    },
                    "aparelhosSinteticos": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "STRESS_INPUT_INVALID, STRESS_FIELDS_INVALID, STRESS_CONCURRENCY_INVALID, STRESS_PLANNED_INVALID, STRESS_PLANNED_BELOW_CONCURRENCY."
          },
          "403": {
            "description": "FORBIDDEN."
          },
          "409": {
            "description": "STRESS_PRODUCTION_CONFIRMATION_REQUIRED."
          }
        }
      }
    },
    "/api/v1/devices/{deviceId}/wifi/interference": {
      "get": {
        "operationId": "wifiInterference",
        "summary": "Consultar interferência por equipamento",
        "x-noori-scope": "wifi.site_survey.view",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serviceId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Projeção contextual; nunca expõe credenciais",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                }
              }
            }
          },
          "400": {
            "description": "Contexto obrigatório ou corpo inválido"
          },
          "403": {
            "description": "Permissão insuficiente ou flag desligada"
          },
          "404": {
            "description": "Vínculo cliente/serviço/equipamento não encontrado no tenant"
          },
          "409": {
            "description": "Capacidade indisponível ou ação não homologada"
          }
        }
      }
    },
    "/api/v1/devices/{deviceId}/wifi/site-survey/latest": {
      "get": {
        "operationId": "wifiSiteSurveyLatest",
        "summary": "Consultar última varredura",
        "x-noori-scope": "wifi.site_survey.view",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serviceId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Projeção contextual; nunca expõe credenciais",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                }
              }
            }
          },
          "400": {
            "description": "Contexto obrigatório ou corpo inválido"
          },
          "403": {
            "description": "Permissão insuficiente ou flag desligada"
          },
          "404": {
            "description": "Vínculo cliente/serviço/equipamento não encontrado no tenant"
          },
          "409": {
            "description": "Capacidade indisponível ou ação não homologada"
          }
        }
      }
    },
    "/api/v1/devices/{deviceId}/wifi/site-survey/history": {
      "get": {
        "operationId": "wifiSiteSurveyHistory",
        "summary": "Consultar histórico de varreduras",
        "x-noori-scope": "wifi.site_survey.view",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serviceId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Projeção contextual; nunca expõe credenciais",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/History"
                }
              }
            }
          },
          "400": {
            "description": "Contexto obrigatório ou corpo inválido"
          },
          "403": {
            "description": "Permissão insuficiente ou flag desligada"
          },
          "404": {
            "description": "Vínculo cliente/serviço/equipamento não encontrado no tenant"
          },
          "409": {
            "description": "Capacidade indisponível ou ação não homologada"
          }
        }
      }
    },
    "/api/v1/devices/{deviceId}/wifi/site-survey": {
      "post": {
        "operationId": "wifiSiteSurvey",
        "summary": "Solicitar varredura",
        "x-noori-scope": "wifi.site_survey.run",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serviceId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Solicitação aceita; acompanhar diagnóstico/task. Não significa coleta concluída."
          },
          "400": {
            "description": "Contexto obrigatório ou corpo inválido"
          },
          "403": {
            "description": "Permissão insuficiente ou flag desligada"
          },
          "404": {
            "description": "Vínculo cliente/serviço/equipamento não encontrado no tenant"
          },
          "409": {
            "description": "Capacidade indisponível ou ação não homologada"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/devices/{deviceId}/wifi/channel": {
      "post": {
        "operationId": "wifiChannel",
        "summary": "Aplicar canal manual e verificar com nova varredura",
        "x-noori-scope": "wifi.channel.change",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serviceId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Tarefa aceita; aplicação ainda não confirmada. Acompanhar channelOperations na projeção de interferência.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "taskId",
                    "reused",
                    "deviceId",
                    "customerId",
                    "serviceId"
                  ],
                  "properties": {
                    "taskId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "deviceId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "customerId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "serviceId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "reused": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Contexto obrigatório ou corpo inválido"
          },
          "403": {
            "description": "Permissão insuficiente ou flag desligada"
          },
          "404": {
            "description": "Vínculo cliente/serviço/equipamento não encontrado no tenant"
          },
          "409": {
            "description": "Capacidade indisponível ou ação não homologada"
          }
        },
        "description": "Exige wifi.channel.change e wifi.site_survey.run. HOMOLOGATE restrito a TENANT_OWNER/TENANT_ADMIN no piloto; APPLY exige evidência completa no rádio selecionado. IdempotencyKey reutilizado com outro conteúdo retorna 409.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "radioId",
                  "channel",
                  "expectedChannel",
                  "expectedAuto",
                  "beforeSurveyId",
                  "idempotencyKey",
                  "confirmed",
                  "mode"
                ],
                "properties": {
                  "radioId": {
                    "type": "string",
                    "pattern": "^Device\\.WiFi\\.Radio\\.[1-9]\\d*$"
                  },
                  "channel": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 233
                  },
                  "expectedChannel": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 233
                  },
                  "expectedAuto": {
                    "type": "boolean"
                  },
                  "beforeSurveyId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "confirmed": {
                    "const": true
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "APPLY",
                      "HOMOLOGATE"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/devices/{deviceId}/wifi/site-survey/capabilities": {
      "post": {
        "operationId": "wifiSiteSurveyCapabilities",
        "summary": "Atualizar valores e capacidades por consultas direcionadas",
        "x-noori-scope": "wifi.site_survey.run",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serviceId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Consultas enfileiradas e contato solicitado.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "taskIds",
                    "reused"
                  ],
                  "properties": {
                    "taskIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "reused": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Contexto obrigatório ou corpo inválido"
          },
          "403": {
            "description": "Permissão insuficiente ou flag desligada"
          },
          "404": {
            "description": "Vínculo cliente/serviço/equipamento não encontrado no tenant"
          },
          "409": {
            "description": "Capacidade indisponível ou ação não homologada"
          }
        },
        "description": "GPN por leaf e GPV isolados; não inicia discovery completo nem altera configuração.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "sessionCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "nooriacs_session"
      },
      "tenantSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "nooriacs_session"
      },
      "session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "nooriacs_session"
      },
      "integrationKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Chave de sistema integrador. Escopos: devices:read, devices:link, devices:reboot, devices:refresh, wifi:write, tasks:read, webhooks:manage. Reset de fábrica e firmware não existem nesta API."
      },
      "operatorSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "nooriacs_session"
      },
      "platformSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "nooriacs_platform_session",
        "description": "Sessão de plataforma com MFA confirmado."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "Updated": {
        "type": "object",
        "properties": {
          "updated": {
            "type": "boolean"
          }
        },
        "required": [
          "updated"
        ],
        "additionalProperties": false
      },
      "Preferences": {
        "type": "object",
        "properties": {
          "securityEmail": {
            "type": "boolean"
          }
        },
        "required": [
          "securityEmail"
        ],
        "additionalProperties": false
      },
      "ProfilePatch": {
        "type": "object",
        "properties": {
          "fullName": {
            "type": "string",
            "maxLength": 160
          },
          "displayName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 128
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "alternatePhone": {
            "type": [
              "string",
              "null"
            ]
          },
          "jobTitle": {
            "type": "string",
            "maxLength": 128
          },
          "department": {
            "type": "string",
            "maxLength": 128
          },
          "locale": {
            "enum": [
              "pt-BR",
              "en-US",
              "es"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "notificationPreferences": {
            "$ref": "#/components/schemas/Preferences"
          }
        },
        "required": [],
        "additionalProperties": false,
        "minProperties": 1
      },
      "Profile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "fullName": {
            "type": [
              "string",
              "null"
            ]
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "alternatePhone": {
            "type": [
              "string",
              "null"
            ]
          },
          "phoneVerifiedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "emailVerifiedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "locale": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "notificationPreferences": {
            "$ref": "#/components/schemas/Preferences"
          },
          "jobTitle": {
            "type": [
              "string",
              "null"
            ]
          },
          "department": {
            "type": [
              "string",
              "null"
            ]
          },
          "localLoginEnabled": {
            "type": "boolean"
          },
          "avatarUpdatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "hasAvatar": {
            "type": "boolean"
          },
          "tenant": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "role"
            ],
            "additionalProperties": false
          },
          "release": {
            "type": "object",
            "properties": {
              "channel": {
                "type": "string"
              },
              "environment": {
                "type": "string"
              },
              "version": {
                "type": "string"
              },
              "plan": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [],
            "additionalProperties": false
          },
          "options": {
            "type": "object",
            "properties": {
              "locales": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "timezones": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "locales",
              "timezones"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "email",
          "fullName",
          "displayName",
          "phone",
          "alternatePhone",
          "phoneVerifiedAt",
          "emailVerifiedAt",
          "locale",
          "timezone",
          "notificationPreferences",
          "jobTitle",
          "department",
          "localLoginEnabled",
          "avatarUpdatedAt",
          "hasAvatar",
          "tenant",
          "release",
          "options"
        ],
        "additionalProperties": false
      },
      "Session": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ipCreated": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastIp": {
            "type": [
              "string",
              "null"
            ]
          },
          "userAgent": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastSeenAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revokedReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "current": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "ipCreated",
          "lastIp",
          "userAgent",
          "createdAt",
          "lastSeenAt",
          "expiresAt",
          "revokedAt",
          "revokedReason",
          "current"
        ],
        "additionalProperties": false
      },
      "SecurityEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "result": {
            "type": [
              "string",
              "null"
            ]
          },
          "ipAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "userAgent": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestId": {
            "type": "string"
          },
          "timestamp": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "event",
          "result",
          "ipAddress",
          "userAgent",
          "requestId",
          "timestamp"
        ],
        "additionalProperties": false
      },
      "MfaState": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "pending": {
            "type": "boolean"
          },
          "verifiedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "recoveryCodesRemaining": {
            "type": "integer",
            "minimum": 0
          },
          "verificationRequired": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled",
          "pending",
          "verifiedAt",
          "recoveryCodesRemaining",
          "verificationRequired"
        ],
        "additionalProperties": false
      },
      "PasswordChange": {
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string",
            "writeOnly": true,
            "maxLength": 128
          },
          "newPassword": {
            "type": "string",
            "writeOnly": true,
            "minLength": 12,
            "maxLength": 128
          },
          "mfaCode": {
            "type": "string",
            "writeOnly": true,
            "maxLength": 128
          },
          "revokeOthers": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "currentPassword",
          "newPassword"
        ],
        "additionalProperties": false
      },
      "MfaInput": {
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string",
            "writeOnly": true
          },
          "code": {
            "type": "string",
            "writeOnly": true
          },
          "mfaCode": {
            "type": "string",
            "writeOnly": true
          }
        },
        "required": [
          "currentPassword"
        ],
        "additionalProperties": false
      },
      "MfaSetup": {
        "type": "object",
        "properties": {
          "secret": {
            "type": "string"
          },
          "uri": {
            "type": "string"
          }
        },
        "required": [
          "secret",
          "uri"
        ],
        "additionalProperties": false
      },
      "MfaResult": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "recoveryCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "enabled"
        ],
        "additionalProperties": false
      },
      "TenantUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "is_owner": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "last_login_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_avatar": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "email",
          "display_name",
          "role",
          "active",
          "is_owner",
          "created_at"
        ],
        "additionalProperties": false
      },
      "AdminSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "expires_at": {
            "type": "string"
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_agent": {
            "type": [
              "string",
              "null"
            ]
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "revoked_reason": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "created_at",
          "expires_at",
          "last_seen_at",
          "ip",
          "last_ip",
          "user_agent",
          "revoked_at",
          "revoked_reason"
        ],
        "additionalProperties": false
      },
      "AdminEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          },
          "ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_agent": {
            "type": [
              "string",
              "null"
            ]
          },
          "request_id": {
            "type": "string"
          },
          "actor_user_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "created_at",
          "action",
          "outcome",
          "ip",
          "user_agent",
          "request_id",
          "actor_user_id"
        ],
        "additionalProperties": false
      },
      "AssignedRole": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "name"
        ],
        "additionalProperties": false
      },
      "RoleRule": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "permission_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "effect": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "name",
          "permission_code",
          "effect"
        ],
        "additionalProperties": false
      },
      "AdminPermissions": {
        "type": "object",
        "properties": {
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssignedRole"
            }
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleRule"
            }
          }
        },
        "required": [
          "roles",
          "permissions",
          "rules"
        ],
        "additionalProperties": false
      },
      "RoleMatrix": {
        "type": "object",
        "properties": {
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssignedRole"
            }
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleRule"
            }
          }
        },
        "required": [
          "roles",
          "rules"
        ],
        "additionalProperties": false
      },
      "RoleAssignment": {
        "type": "object",
        "properties": {
          "roles": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            },
            "minItems": 1,
            "maxItems": 8,
            "uniqueItems": true
          }
        },
        "required": [
          "roles"
        ],
        "additionalProperties": false
      },
      "MailMessage": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": false
      },
      "MailUpdated": {
        "type": "object",
        "properties": {
          "updated": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "updated",
          "message"
        ],
        "additionalProperties": false
      },
      "ForgotPassword": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "ResetPassword": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "writeOnly": true
          },
          "newPassword": {
            "type": "string",
            "minLength": 12,
            "maxLength": 128,
            "writeOnly": true
          },
          "mfaCode": {
            "type": "string",
            "maxLength": 32,
            "writeOnly": true
          }
        },
        "required": [
          "token",
          "newPassword"
        ],
        "additionalProperties": false
      },
      "EmailChange": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "currentPassword": {
            "type": "string",
            "maxLength": 128,
            "writeOnly": true
          },
          "mfaCode": {
            "type": "string",
            "maxLength": 32,
            "writeOnly": true
          }
        },
        "required": [
          "email",
          "currentPassword"
        ],
        "additionalProperties": false
      },
      "EmailConfirmation": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "writeOnly": true
          }
        },
        "required": [
          "token"
        ],
        "additionalProperties": false
      },
      "MfaSessionVerification": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 32,
            "writeOnly": true
          }
        },
        "required": [
          "code"
        ],
        "additionalProperties": false
      },
      "MfaSessionVerified": {
        "type": "object",
        "properties": {
          "verified": {
            "type": "boolean"
          }
        },
        "required": [
          "verified"
        ],
        "additionalProperties": false
      },
      "MailSettings": {
        "type": "object",
        "properties": {
          "featureEnabled": {
            "type": "boolean"
          },
          "allowedHosts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer"
          },
          "useGlobal": {
            "type": "boolean"
          },
          "globalAllowed": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "security": {
            "enum": [
              "TLS",
              "STARTTLS"
            ]
          },
          "fromEmail": {
            "type": "string"
          },
          "fromName": {
            "type": "string"
          },
          "credentialsPresent": {
            "type": "boolean"
          },
          "lastTestedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastErrorCode": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "featureEnabled",
          "allowedHosts",
          "enabled",
          "revision",
          "useGlobal",
          "globalAllowed",
          "host",
          "port",
          "security",
          "fromEmail",
          "fromName",
          "credentialsPresent",
          "lastTestedAt",
          "lastErrorCode"
        ],
        "additionalProperties": false
      },
      "MailSettingsUpdate": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "useGlobal": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535
          },
          "security": {
            "enum": [
              "TLS",
              "STARTTLS"
            ]
          },
          "username": {
            "type": "string",
            "maxLength": 254,
            "writeOnly": true
          },
          "password": {
            "type": "string",
            "maxLength": 2048,
            "writeOnly": true
          },
          "fromEmail": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "fromName": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "enabled",
          "revision",
          "useGlobal"
        ],
        "additionalProperties": false
      },
      "MailTest": {
        "type": "object",
        "properties": {
          "notificationId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "notificationId",
          "message"
        ],
        "additionalProperties": false
      },
      "MailLog": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "event": {
            "type": "string"
          },
          "recipientMasked": {
            "type": "string"
          },
          "status": {
            "enum": [
              "PENDING",
              "SENDING",
              "SENT",
              "FAILED",
              "UNKNOWN"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3
          },
          "failureCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "sentAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "event",
          "recipientMasked",
          "status",
          "attempts",
          "failureCode",
          "createdAt",
          "sentAt",
          "requestId"
        ],
        "additionalProperties": false
      },
      "AccountEvent": {
        "type": "object",
        "properties": {
          "specversion": {
            "const": "1.0"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "source": {
            "const": "nooriacs/account"
          },
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestId": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "actorUserId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "resourceType": {
                "type": "string"
              },
              "result": {
                "type": "string"
              }
            },
            "required": [
              "actorUserId",
              "resourceType",
              "result"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "specversion",
          "id",
          "type",
          "source",
          "time",
          "tenantId",
          "subject",
          "requestId",
          "data"
        ],
        "additionalProperties": false
      },
      "TenantInvitationInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "role": {
            "enum": [
              "TENANT_ADMIN",
              "SUPERVISOR",
              "ATTENDANT",
              "TECHNICIAN",
              "READ_ONLY"
            ]
          },
          "displayName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 128
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40
          },
          "requireMfa": {
            "type": "boolean"
          }
        },
        "required": [
          "email",
          "role"
        ],
        "additionalProperties": false
      },
      "MailLogPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailLog"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "items",
          "page",
          "hasMore"
        ],
        "additionalProperties": false
      },
      "AccountEventPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountEvent"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "items",
          "page",
          "hasMore"
        ],
        "additionalProperties": false
      },
      "TenantInvitation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "email",
          "role",
          "expires_at",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING"
            ]
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": [
              "TENANT_ADMIN",
              "SUPERVISOR",
              "ATTENDANT",
              "TECHNICIAN",
              "READ_ONLY"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TenantInvitationCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "email",
          "role",
          "expires_at",
          "created_at",
          "inviteUrl",
          "delivery"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING"
            ]
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": [
              "TENANT_ADMIN",
              "SUPERVISOR",
              "ATTENDANT",
              "TECHNICIAN",
              "READ_ONLY"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "inviteUrl": {
            "type": "string",
            "format": "uri",
            "description": "Link secreto emitido uma única vez; não registrar em logs."
          },
          "delivery": {
            "type": "string",
            "enum": [
              "QUEUED",
              "UNAVAILABLE",
              "DISABLED"
            ]
          }
        }
      },
      "TenantInvitationPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantInvitation"
            }
          }
        }
      },
      "TenantInvitationAccept": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "token",
          "displayName",
          "password"
        ],
        "properties": {
          "token": {
            "type": "string",
            "writeOnly": true,
            "minLength": 40,
            "maxLength": 128
          },
          "displayName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 128
          },
          "password": {
            "type": "string",
            "writeOnly": true,
            "minLength": 12,
            "maxLength": 128
          }
        }
      },
      "TenantInvitationAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accepted",
          "tenant",
          "email"
        ],
        "properties": {
          "accepted": {
            "const": true
          },
          "tenant": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          }
        }
      },
      "Revoked": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revoked"
        ],
        "properties": {
          "revoked": {
            "const": true
          }
        }
      },
      "AcsSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revision",
          "acsUrl",
          "acsUsername",
          "acsPasswordPresent",
          "connectionRequestPath",
          "connectionRequestPort",
          "connectionRequestUsername",
          "connectionRequestPasswordPresent",
          "fallbackEnabled",
          "credentialReadable",
          "updatedAt",
          "endpoints",
          "fallbackModes",
          "autoProvisionEnabled",
          "autoProvisionModes"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "acsUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Endpoint da origem configurada e alias ativo da empresa; selecionar somente valores de endpoints."
          },
          "acsUsername": {
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "acsPasswordPresent": {
            "type": "boolean"
          },
          "connectionRequestPath": {
            "type": "string",
            "maxLength": 256,
            "pattern": "^/[A-Za-z0-9._~/-]*$",
            "description": "Referência para configurar a ONT; segmentos . e .. e barras duplas são recusados. Não substitui URL anunciada."
          },
          "connectionRequestPort": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535
          },
          "connectionRequestUsername": {
            "type": "string",
            "maxLength": 128
          },
          "connectionRequestPasswordPresent": {
            "type": "boolean"
          },
          "fallbackEnabled": {
            "type": "boolean"
          },
          "credentialReadable": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "endpoints": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "value",
                "label"
              ],
              "properties": {
                "value": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              }
            }
          },
          "fallbackModes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "value",
                "label"
              ],
              "properties": {
                "value": {
                  "type": "boolean"
                },
                "label": {
                  "type": "string"
                }
              }
            }
          },
          "autoProvisionEnabled": {
            "type": "boolean"
          },
          "autoProvisionModes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "value",
                "label"
              ],
              "properties": {
                "value": {
                  "type": "boolean"
                },
                "label": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "AcsSettingsInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revision",
          "acsUrl",
          "acsUsername",
          "connectionRequestPath",
          "connectionRequestPort",
          "connectionRequestUsername",
          "fallbackEnabled"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "acsUrl": {
            "type": "string",
            "format": "uri",
            "description": "Endpoint da origem configurada e alias ativo da empresa; selecionar somente valores de endpoints."
          },
          "acsUsername": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "connectionRequestPath": {
            "type": "string",
            "maxLength": 256,
            "pattern": "^/[A-Za-z0-9._~/-]*$",
            "description": "Referência para configurar a ONT; segmentos . e .. e barras duplas são recusados. Não substitui URL anunciada."
          },
          "connectionRequestPort": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535
          },
          "connectionRequestUsername": {
            "type": "string",
            "maxLength": 128
          },
          "fallbackEnabled": {
            "type": "boolean"
          },
          "acsPassword": {
            "type": "string",
            "format": "password",
            "writeOnly": true,
            "minLength": 1,
            "maxLength": 256,
            "description": "Omitir mantém senha cadastrada. Vazio, marcadores mascarados e controles são recusados. Troca de usuário exige senha correspondente."
          },
          "connectionRequestPassword": {
            "type": "string",
            "format": "password",
            "writeOnly": true,
            "minLength": 1,
            "maxLength": 256,
            "description": "Omitir mantém senha cadastrada. Vazio, marcadores mascarados e controles são recusados. Troca de usuário exige senha correspondente."
          },
          "autoProvisionEnabled": {
            "type": "boolean",
            "description": "Omitido preserva a política existente. Ativação exige acs:manage e tasks:execute; usa par reverso padrão cifrado da empresa."
          }
        }
      },
      "ConnectionProvisioningStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "counts",
          "page",
          "limit",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "deviceId",
                "serial",
                "firmware",
                "state",
                "label",
                "message",
                "taskId",
                "checkedAt",
                "lastInformAt"
              ],
              "properties": {
                "deviceId": {
                  "type": "string",
                  "format": "uuid"
                },
                "serial": {
                  "type": "string"
                },
                "firmware": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "PENDING",
                    "QUEUED",
                    "VERIFYING",
                    "READY",
                    "FAILED",
                    "UNSUPPORTED"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "message": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "taskId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "checkedAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "lastInformAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "counts": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "state",
                "count"
              ],
              "properties": {
                "state": {
                  "type": "string",
                  "enum": [
                    "PENDING",
                    "QUEUED",
                    "VERIFYING",
                    "READY",
                    "FAILED",
                    "UNSUPPORTED"
                  ]
                },
                "count": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "limit": {
            "const": 25
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "Compatibility": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "firmwareVersions",
          "excludedAttributePrefixes"
        ],
        "properties": {
          "firmwareVersions": {
            "type": "array",
            "maxItems": 32,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "description": "Versões completas exatas informadas pela ONT. Vazio é perfil genérico; perfil específico tem precedência."
          },
          "excludedAttributePrefixes": {
            "type": "array",
            "maxItems": 32,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "maxLength": 512,
              "pattern": "^(Device|InternetGatewayDevice)\\.(?:[A-Za-z0-9_:-]+\\.)+$"
            },
            "description": "Subárvores sem GetParameterAttributes, incluindo consultas ao ancestral. Não restringe GetParameterValues. Requer firmwareVersions não vazio."
          },
          "wifiInputAliases": {
            "type": "array",
            "maxItems": 16,
            "description": "Aliases explícitos de entrada Basic por banda/campo. Exigem firmware delimitado e slot único no perfil homologado. PUT omitido preserva; [] remove. Escrita usa somente destino canônico do perfil, nunca o caminho recebido.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "path",
                "band",
                "field"
              ],
              "properties": {
                "path": {
                  "type": "string",
                  "maxLength": 512,
                  "description": "Folha Wi-Fi TR-181 ou TR-098 de SSID ou KeyPassphrase/PreSharedKey, coerente com field; caminho único."
                },
                "band": {
                  "type": "string",
                  "enum": [
                    "2.4GHZ",
                    "5GHZ"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "ssid",
                    "password"
                  ]
                }
              }
            }
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "excludedAttributePrefixes": {
                  "minItems": 1
                }
              }
            },
            "then": {
              "properties": {
                "firmwareVersions": {
                  "minItems": 1
                }
              }
            }
          },
          {
            "if": {
              "required": [
                "wifiInputAliases"
              ],
              "properties": {
                "wifiInputAliases": {
                  "minItems": 1
                }
              }
            },
            "then": {
              "properties": {
                "firmwareVersions": {
                  "minItems": 1
                }
              }
            }
          }
        ]
      },
      "ProfileWrite": {
        "type": "object",
        "required": [
          "name",
          "manufacturer",
          "model",
          "dataModel",
          "mappings"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "manufacturer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "productClass": {
            "type": [
              "string",
              "null"
            ]
          },
          "oui": {
            "type": [
              "string",
              "null"
            ]
          },
          "dataModel": {
            "enum": [
              "TR181",
              "TR098",
              "VENDOR"
            ]
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "validationState": {
            "enum": [
              "DRAFT",
              "VALIDATING",
              "HOMOLOGATED"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "mappings": {
            "type": "array",
            "minItems": 1,
            "maxItems": 2,
            "items": {
              "type": "object",
              "required": [
                "band",
                "ssidPath",
                "passwordPath"
              ],
              "properties": {
                "band": {
                  "enum": [
                    "2.4GHZ",
                    "5GHZ"
                  ]
                },
                "ssidPath": {
                  "type": "string"
                },
                "passwordPath": {
                  "type": "string"
                }
              }
            }
          },
          "firmwareIds": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "compatibility": {
            "$ref": "#/components/schemas/Compatibility"
          },
          "referenceDeviceId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "CPE de referencia do tenant autenticado. Confirma modelo, fabricante/OUI, hardware, arvore e versao instalada. Exige versao em compatibility.firmwareVersions. PUT omitido preserva e revalida referencia; null remove. Nao autoriza download nem homologa escrita automaticamente."
          }
        },
        "additionalProperties": true,
        "description": "Mantém campos existentes de mappings PPPoE/diagnóstico/telemetria/alertas. No PUT, compatibility omitido preserva a política. Objeto explícito substitui. Perfil ativo homologado exige hardware pelos vínculos de firmware ou referenceDeviceId validado; alterar elegibilidade de perfil vinculado exige firmware:approve e reenviar firmwareIds."
      },
      "CustomerList": {
        "type": "object",
        "required": [
          "items",
          "totalsVisible",
          "summary",
          "pagination"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "totalsVisible": {
            "type": "boolean"
          },
          "summary": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            }
          },
          "pagination": {
            "type": "object",
            "required": [
              "page",
              "limit",
              "total",
              "totalPages",
              "hasNext"
            ],
            "properties": {
              "page": {
                "type": "integer",
                "minimum": 1
              },
              "limit": {
                "type": "integer",
                "minimum": 5,
                "maximum": 50
              },
              "total": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "totalPages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "hasNext": {
                "type": "boolean"
              }
            }
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "totalsVisible": {
                  "const": false
                }
              }
            },
            "then": {
              "properties": {
                "summary": {
                  "type": "null"
                },
                "pagination": {
                  "properties": {
                    "total": {
                      "type": "null"
                    },
                    "totalPages": {
                      "type": "null"
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "CustomerInventory": {
        "type": "object",
        "required": [
          "items",
          "totalsVisible",
          "summary"
        ],
        "properties": {
          "items": {
            "type": "array"
          },
          "totalsVisible": {
            "type": "boolean"
          },
          "summary": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "totalsVisible": {
                  "const": false
                }
              }
            },
            "then": {
              "properties": {
                "summary": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "IntegrationStatus": {
        "type": "object",
        "required": [
          "lastRun"
        ],
        "properties": {
          "lastRun": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "customers_seen": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "services_seen": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "auto_links_created": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "status": {
                "type": "string"
              }
            }
          }
        }
      },
      "IntegrationError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "UNAUTHENTICATED, INSUFFICIENT_SCOPE, DEVICE_NOT_FOUND, TASK_NOT_FOUND, DEVICE_OFFLINE, DEVICE_LINK_NOT_CONFIRMED, DEVICE_LINK_CONFLICT, WIFI_PROFILE_NOT_FOUND, WIFI_PASSWORD_INVALID, REBOOT_TASK_ALREADY_ACTIVE, REBOOT_TOO_SOON, RATE_LIMITED, IDEMPOTENCY_KEY_INVALID, IDEMPOTENCY_KEY_REUSED, WIFI_CHANNEL_IDEMPOTENCY_CONFLICT, INTEGRATION_BUSY, IMMEDIATE_DELIVERY_FAILED, INTEGRATION_ACTOR_INVALID, INTEGRATION_EXTERNAL_REF_INVALID, INTEGRATION_LOOKUP_INVALID, INTEGRATION_LOOKUP_EMPTY, INTEGRATION_LOOKUP_PROVIDER_REQUIRED, CAPABILITY_DISCOVERY_REQUIRED, CPE_RPC_NOT_SUPPORTED, WAN_NOT_DISCOVERED, WIFI_DEVICE_AMBIGUOUS, CENTRAL_LIMIT_API_REQUESTS"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "requiredScope": {
            "type": "string"
          },
          "retryAfterSeconds": {
            "type": "integer"
          },
          "taskId": {
            "type": "string"
          },
          "deliveryCode": {
            "type": "string"
          },
          "link": {
            "$ref": "#/components/schemas/IntegrationLink"
          }
        }
      },
      "IntegrationMe": {
        "type": "object",
        "required": [
          "integrator",
          "tenant",
          "scopes",
          "apiVersion",
          "product"
        ],
        "properties": {
          "integrator": {
            "type": "string"
          },
          "tenant": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "apiVersion": {
            "type": "string",
            "enum": [
              "v1"
            ]
          },
          "product": {
            "type": "string",
            "enum": [
              "NOORI_ACS"
            ]
          }
        }
      },
      "IntegrationTarget": {
        "type": "object",
        "description": "Ao menos um identificador. provider é obrigatório com serviceExternalId, serviceNumber ou pppoeLogin.",
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "HUBSOFT",
              "SGP"
            ]
          },
          "serviceExternalId": {
            "type": "string",
            "description": "Identificador do serviço no ERP (id_cliente_servico no HubSoft)"
          },
          "serviceNumber": {
            "type": "string"
          },
          "pppoeLogin": {
            "type": "string"
          },
          "physicalIdentifier": {
            "type": "string",
            "description": "Serial GPON em qualquer codificação, serial do equipamento ou MAC, como o ERP informa"
          },
          "macAddress": {
            "type": "string"
          }
        }
      },
      "IntegrationLink": {
        "type": "object",
        "required": [
          "state",
          "reason",
          "actionAllowed"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "CONFIRMED",
              "UNCONFIRMED",
              "NOT_LINKED",
              "AMBIGUOUS",
              "CONFLICT"
            ],
            "description": "Só CONFIRMED libera ação remota"
          },
          "reason": {
            "type": "string",
            "enum": [
              "SERIAL_MATCH",
              "ASSIGNMENT_SERIAL",
              "HUMAN_CONFIRMED",
              "MAC_ONLY",
              "SERVICE_NOT_MIRRORED",
              "SERVICE_INACTIVE",
              "MULTIPLE_SERVICES",
              "NO_DEVICE",
              "MULTIPLE_DEVICES",
              "ERP_POINTS_TO_OTHER_DEVICE",
              "ERP_IDENTITY_CHANGED",
              "DEVICE_LINKED_TO_OTHER_SERVICE"
            ]
          },
          "actionAllowed": {
            "type": "boolean"
          },
          "serviceExternalId": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "IntegrationDevice": {
        "type": "object",
        "required": [
          "id",
          "serialNumber",
          "online"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "serialNumber": {
            "type": "string"
          },
          "oui": {
            "type": "string"
          },
          "manufacturer": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "firmwareVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "online": {
            "type": "boolean"
          },
          "lastInformAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "IntegrationActionAvailability": {
        "type": "object",
        "required": [
          "allowed",
          "blockedBy"
        ],
        "properties": {
          "allowed": {
            "type": "boolean"
          },
          "blockedBy": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "IntegrationLookupResult": {
        "type": "object",
        "required": [
          "source",
          "observedAt",
          "link",
          "device",
          "candidates",
          "actions",
          "mirror"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "NOORIACS"
            ]
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "link": {
            "$ref": "#/components/schemas/IntegrationLink"
          },
          "device": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/IntegrationDevice"
              },
              {
                "type": "null"
              }
            ]
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationDevice"
            }
          },
          "actions": {
            "type": "object",
            "required": [
              "reboot",
              "wifi"
            ],
            "properties": {
              "reboot": {
                "$ref": "#/components/schemas/IntegrationActionAvailability"
              },
              "wifi": {
                "$ref": "#/components/schemas/IntegrationActionAvailability"
              }
            }
          },
          "mirror": {
            "type": "object",
            "description": "Atualidade do espelho do ERP. O espelho é sincronizado sob demanda",
            "required": [
              "serviceFound"
            ],
            "properties": {
              "serviceFound": {
                "type": "boolean"
              },
              "serviceLastSeenAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "lastSyncAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          }
        }
      },
      "IntegrationActor": {
        "type": "object",
        "required": [
          "type",
          "id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "USER",
              "AUTOMATION",
              "SYSTEM"
            ]
          },
          "id": {
            "type": "string",
            "maxLength": 64
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 80
          }
        }
      },
      "IntegrationActionRequest": {
        "type": "object",
        "required": [
          "target",
          "actor",
          "externalRef"
        ],
        "properties": {
          "target": {
            "$ref": "#/components/schemas/IntegrationTarget"
          },
          "actor": {
            "$ref": "#/components/schemas/IntegrationActor"
          },
          "externalRef": {
            "type": "string",
            "maxLength": 128,
            "description": "Referência do sistema chamador, por exemplo ticket:1001"
          }
        }
      },
      "IntegrationWifiRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/IntegrationActionRequest"
          }
        ],
        "type": "object",
        "properties": {
          "band": {
            "type": "string",
            "enum": [
              "2.4GHZ",
              "5GHZ",
              "BOTH"
            ]
          },
          "password": {
            "type": "string",
            "minLength": 8,
            "maxLength": 63,
            "writeOnly": true
          },
          "ssid": {
            "type": "string",
            "maxLength": 32
          }
        }
      },
      "IntegrationLinkRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/IntegrationActionRequest"
          }
        ],
        "type": "object",
        "required": [
          "deviceId"
        ],
        "properties": {
          "deviceId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "IntegrationLinkResult": {
        "type": "object",
        "required": [
          "link",
          "deviceId",
          "changed"
        ],
        "properties": {
          "link": {
            "$ref": "#/components/schemas/IntegrationLink"
          },
          "deviceId": {
            "type": "string"
          },
          "changed": {
            "type": "boolean"
          }
        }
      },
      "IntegrationRefreshRequest": {
        "type": "object",
        "required": [
          "actor",
          "externalRef"
        ],
        "properties": {
          "actor": {
            "$ref": "#/components/schemas/IntegrationActor"
          },
          "externalRef": {
            "type": "string"
          },
          "what": {
            "type": "string",
            "enum": [
              "telemetry",
              "connected-devices"
            ]
          }
        }
      },
      "IntegrationRefreshResult": {
        "type": "object",
        "required": [
          "accepted",
          "what",
          "reused"
        ],
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "what": {
            "type": "string"
          },
          "taskId": {
            "type": [
              "string",
              "null"
            ]
          },
          "reused": {
            "type": "boolean"
          },
          "skipped": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "DEVICE_BUSY",
              "RECENT_COLLECTION",
              "CURRENT_READING",
              null
            ]
          }
        }
      },
      "IntegrationTaskState": {
        "type": "string",
        "enum": [
          "ACCEPTED",
          "SENT",
          "AWAITING_REBOOT",
          "CONFIRMED",
          "UNCONFIRMED",
          "FAILED",
          "EXPIRED"
        ]
      },
      "IntegrationTask": {
        "type": "object",
        "required": [
          "taskId",
          "deviceId",
          "action",
          "state",
          "reason",
          "delivered",
          "terminal",
          "acknowledged",
          "awaitingReboot"
        ],
        "properties": {
          "taskId": {
            "type": "string",
            "format": "uuid"
          },
          "deviceId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "type": "string",
            "enum": [
              "REBOOT",
              "WIFI_CHANGE",
              "WIFI_CHANNEL",
              "READ_REFRESH"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/IntegrationTaskState"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "PASSWORD_NOT_READABLE",
              "CONFIRMATION_WINDOW_ELAPSED",
              "REBOOT_NOT_CONFIRMED",
              "NOT_DELIVERED",
              "VALUE_DIVERGED",
              "CANCELED",
              "DEVICE_FAULT",
              null
            ]
          },
          "delivered": {
            "type": "boolean",
            "description": "false quando o comando não chegou ao equipamento"
          },
          "terminal": {
            "type": "boolean"
          },
          "acknowledged": {
            "type": "boolean",
            "description": "O equipamento respondeu ao comando. Não significa aplicado"
          },
          "awaitingReboot": {
            "type": "boolean"
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "dispatchedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": "string"
          },
          "replayed": {
            "type": "boolean"
          },
          "connectionRequest": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "IMMEDIATE",
              "NEXT_INFORM",
              null
            ],
            "description": "Só na troca de Wi-Fi. IMMEDIATE: o Connection Request foi aceito e a sessão CWMP já começou. NEXT_INFORM: o ACS não alcança o equipamento de fora (CGNAT, firewall, rota) e a alteração ficou na fila do próximo contato dele. Nulo em repetição por Idempotency-Key e nas outras ações."
          },
          "deliveryMessage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Explicação em português do que aconteceu com a entrega. Nunca contém endereço, credencial nem segredo."
          },
          "bands": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "IntegrationMetric": {
        "oneOf": [
          {
            "type": "null"
          },
          {
            "type": "object",
            "properties": {
              "value": {},
              "unit": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "observedAt": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        ]
      },
      "IntegrationSummary": {
        "type": "object",
        "required": [
          "source",
          "readAt",
          "live",
          "stale",
          "staleAfterSeconds",
          "device",
          "optical",
          "wifi",
          "connectedDevices"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "NOORIACS"
            ]
          },
          "readAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastInformAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "staleAfterSeconds": {
            "type": "integer"
          },
          "stale": {
            "type": "boolean"
          },
          "live": {
            "type": "boolean",
            "enum": [
              false
            ],
            "description": "Sempre false: é a última leitura, não uma consulta ao vivo"
          },
          "device": {
            "$ref": "#/components/schemas/IntegrationDevice"
          },
          "optical": {
            "type": "object",
            "properties": {
              "rx": {
                "$ref": "#/components/schemas/IntegrationMetric"
              },
              "tx": {
                "$ref": "#/components/schemas/IntegrationMetric"
              },
              "temperature": {
                "$ref": "#/components/schemas/IntegrationMetric"
              },
              "ponStatus": {
                "$ref": "#/components/schemas/IntegrationMetric"
              }
            }
          },
          "wan": {
            "type": "object",
            "properties": {
              "status": {
                "$ref": "#/components/schemas/IntegrationMetric"
              },
              "uptime": {
                "$ref": "#/components/schemas/IntegrationMetric"
              }
            }
          },
          "wifi": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "band": {
                  "type": "string"
                },
                "ssid": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "observedAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "current": {
                  "type": "boolean"
                }
              }
            }
          },
          "connectedDevices": {
            "type": "object",
            "properties": {
              "available": {
                "type": "boolean"
              },
              "state": {
                "type": "string"
              },
              "observedAt": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "current": {
                "type": "integer"
              },
              "wifi24": {
                "type": "integer"
              },
              "wifi5": {
                "type": "integer"
              },
              "ethernet": {
                "type": "integer"
              }
            }
          },
          "profile": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "homologated": {
                    "type": "boolean"
                  }
                }
              }
            ]
          },
          "alerts": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "lastBootAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastReboot": {
            "type": [
              "object",
              "null"
            ]
          },
          "opticalHealthy": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Sinal óptico dentro da faixa. null sem leitura"
          }
        }
      },
      "IntegrationConnectedDevices": {
        "type": "object",
        "required": [
          "source",
          "readAt",
          "live",
          "available",
          "items"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "NOORIACS"
            ]
          },
          "readAt": {
            "type": "string"
          },
          "live": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "state": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "macMasked": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "connection": {
                  "type": "string"
                },
                "band": {
                  "type": "string"
                },
                "ssid": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "signalDbm": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "state": {
                  "type": "string"
                },
                "lastSeenAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "summary": {
            "type": "object"
          },
          "pagination": {
            "type": "object"
          }
        }
      },
      "IntegrationChannelImpact": {
        "type": "object",
        "required": [
          "disconnectsClients",
          "approximateSeconds",
          "message"
        ],
        "properties": {
          "disconnectsClients": {
            "type": "boolean"
          },
          "approximateSeconds": {
            "type": "integer"
          },
          "message": {
            "type": "string",
            "description": "Texto para avisar o cliente antes da troca"
          }
        }
      },
      "IntegrationChannelBand": {
        "type": "object",
        "required": [
          "band",
          "currentChannel",
          "interference",
          "recommendedChannel",
          "conclusive",
          "reason",
          "allowedChannels",
          "channels",
          "canApply",
          "blockedBy"
        ],
        "properties": {
          "band": {
            "type": "string",
            "enum": [
              "2.4GHZ",
              "5GHZ",
              "6GHZ"
            ]
          },
          "currentChannel": {
            "type": "integer"
          },
          "auto": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "widthMHz": {
            "type": [
              "integer",
              "null"
            ]
          },
          "interference": {
            "type": "object",
            "properties": {
              "score": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "level": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "neighbors": {
                "type": "integer",
                "description": "Quantidade de redes vizinhas, sem nomes de terceiros"
              }
            }
          },
          "recommendedChannel": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Só recomendação. Nunca aplica sozinha"
          },
          "conclusive": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "allowedChannels": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Permitidos no equipamento e no Brasil"
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "channel": {
                  "type": "integer"
                },
                "networks": {
                  "type": "integer"
                },
                "score": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "dfs": {
                  "type": "boolean"
                }
              }
            }
          },
          "canApply": {
            "type": "boolean"
          },
          "blockedBy": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "WIFI_CHANNEL_EVIDENCE_STALE",
                "WIFI_CHANNEL_NOT_HOMOLOGATED"
              ]
            }
          }
        }
      },
      "IntegrationChannelView": {
        "type": "object",
        "required": [
          "source",
          "readAt",
          "live",
          "scan",
          "bands",
          "lastChange",
          "impact"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "NOORIACS"
            ]
          },
          "readAt": {
            "type": "string",
            "format": "date-time"
          },
          "live": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "scan": {
            "type": "object",
            "required": [
              "supported",
              "code",
              "state"
            ],
            "properties": {
              "supported": {
                "type": "boolean"
              },
              "code": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "CHANNEL_SCAN_UNSUPPORTED",
                  null
                ]
              },
              "state": {
                "type": "string"
              },
              "surveyId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collectedAt": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "bands": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationChannelBand"
            }
          },
          "lastChange": {
            "type": [
              "object",
              "null"
            ],
            "description": "Última troca, com canal anterior para reverter"
          },
          "impact": {
            "$ref": "#/components/schemas/IntegrationChannelImpact"
          }
        }
      },
      "IntegrationChannelScan": {
        "type": "object",
        "required": [
          "state",
          "surveyId"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "PREPARING",
              "SCANNING"
            ],
            "description": "PREPARING: repita o pedido até SCANNING"
          },
          "surveyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "reused": {
            "type": "boolean"
          }
        }
      },
      "IntegrationChannelRequest": {
        "type": "object",
        "required": [
          "target",
          "actor",
          "externalRef",
          "band"
        ],
        "description": "Informe channel, auto=true ou revert=true.",
        "properties": {
          "target": {
            "$ref": "#/components/schemas/IntegrationLookupRequest"
          },
          "actor": {
            "type": "object"
          },
          "externalRef": {
            "type": "string"
          },
          "band": {
            "type": "string",
            "enum": [
              "2.4GHZ",
              "5GHZ",
              "6GHZ"
            ]
          },
          "channel": {
            "type": "integer"
          },
          "auto": {
            "type": "boolean"
          },
          "revert": {
            "type": "boolean"
          }
        }
      },
      "IntegrationChannelChange": {
        "type": "object",
        "required": [
          "taskId",
          "deviceId",
          "action",
          "state",
          "previous",
          "impact"
        ],
        "properties": {
          "taskId": {
            "type": "string",
            "format": "uuid"
          },
          "deviceId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "type": "string",
            "enum": [
              "REBOOT",
              "WIFI_CHANGE",
              "WIFI_CHANNEL",
              "READ_REFRESH"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/IntegrationTaskState"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "PASSWORD_NOT_READABLE",
              "CONFIRMATION_WINDOW_ELAPSED",
              "REBOOT_NOT_CONFIRMED",
              "NOT_DELIVERED",
              "VALUE_DIVERGED",
              "CANCELED",
              "DEVICE_FAULT",
              null
            ]
          },
          "delivered": {
            "type": "boolean",
            "description": "false quando o comando não chegou ao equipamento"
          },
          "terminal": {
            "type": "boolean"
          },
          "acknowledged": {
            "type": "boolean",
            "description": "O equipamento respondeu ao comando. Não significa aplicado"
          },
          "awaitingReboot": {
            "type": "boolean"
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "dispatchedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": "string"
          },
          "replayed": {
            "type": "boolean"
          },
          "connectionRequest": {
            "type": [
              "string",
              "null"
            ]
          },
          "bands": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "previous": {
            "type": "object",
            "properties": {
              "channel": {
                "type": "integer"
              },
              "auto": {
                "type": "boolean"
              }
            }
          },
          "impact": {
            "$ref": "#/components/schemas/IntegrationChannelImpact"
          }
        }
      },
      "WebhookSubscription": {
        "type": "object",
        "required": [
          "id",
          "url",
          "events",
          "enabled"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Destino HTTPS. Endereco nao publico e recusado no cadastro."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "task.completed",
                "device.online",
                "device.offline"
              ]
            }
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "enabled": {
            "type": "boolean",
            "description": "Desligada automaticamente apos 20 falhas seguidas."
          },
          "disabledReason": {
            "type": "string",
            "nullable": true,
            "enum": [
              "TOO_MANY_FAILURES",
              null
            ]
          },
          "consecutiveFailures": {
            "type": "integer"
          },
          "lastDeliveryAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastStatus": {
            "type": "string",
            "nullable": true,
            "enum": [
              "SENT",
              "FAILED",
              "PENDING",
              "UNKNOWN",
              null
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookEnvelope": {
        "type": "object",
        "description": "Corpo entregue no POST. Repeticao e possivel: use `id` para descartar o que ja tratou.",
        "required": [
          "id",
          "event",
          "occurredAt",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Identificador do FATO. Igual ao cabecalho X-Noori-Delivery."
          },
          "event": {
            "type": "string",
            "enum": [
              "task.completed",
              "device.online",
              "device.offline"
            ]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "apiVersion": {
            "type": "string",
            "example": "v1"
          },
          "product": {
            "type": "string",
            "example": "NOORI_ACS"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "MacOperation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "serviceId",
          "status",
          "errorCode"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "serviceId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "RUNNING",
              "SUCCESS",
              "FAILED",
              "UNKNOWN",
              "SKIPPED"
            ]
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CenterList": {
        "type": "object",
        "required": [
          "items",
          "availableScopes",
          "capabilities",
          "apiBaseUrl"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CenterItem"
            }
          },
          "tenant": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            }
          },
          "availableScopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Capability"
            }
          },
          "apiBaseUrl": {
            "type": "string",
            "format": "uri",
            "description": "Endereço que o sistema integrador configura do lado dele. Não é segredo."
          },
          "docsUrl": {
            "type": "string",
            "format": "uri"
          },
          "slowResponseMs": {
            "type": "integer",
            "description": "Acima disso a integração é considerada lenta, não quebrada."
          }
        }
      },
      "CenterItem": {
        "type": "object",
        "required": [
          "kind",
          "id",
          "name",
          "direction",
          "state",
          "enabled",
          "lastCheck"
        ],
        "properties": {
          "kind": {
            "enum": [
              "INBOUND_KEY",
              "OUTBOUND_ERP"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "direction": {
            "enum": [
              "INBOUND",
              "OUTBOUND"
            ]
          },
          "provider": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "enum": [
              "ACTIVE",
              "DISABLED",
              "REVOKED",
              "EXPIRED",
              "NOT_CONFIGURED",
              "CONNECTED",
              "ERROR"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "keyPrefix": {
            "type": "string",
            "description": "Início da chave. Serve para identificar a credencial em uso; não autentica."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowedCidrs": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Nulo é qualquer origem. Preenchido, só estes IPs e redes autenticam."
          },
          "webhooks": {
            "type": "integer"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastUsedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "rotatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revision": {
            "type": "integer"
          },
          "configured": {
            "type": "boolean"
          },
          "lastSyncedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastErrorCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastCheck": {
            "type": [
              "object",
              "null"
            ],
            "description": "Nulo é não testada. O estado nunca é inventado a partir de a URL responder.",
            "properties": {
              "status": {
                "enum": [
                  "OPERATIONAL",
                  "DEGRADED",
                  "DOWN"
                ]
              },
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "durationMs": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Capability": {
        "type": "object",
        "required": [
          "key",
          "group",
          "label",
          "scope",
          "mutating"
        ],
        "description": "Folha da árvore de permissões, amarrada ao escopo que a rota exige no backend.",
        "properties": {
          "key": {
            "type": "string"
          },
          "group": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "mutating": {
            "type": "boolean",
            "description": "Verdadeiro quando a função altera o equipamento do cliente."
          }
        }
      },
      "HealthResult": {
        "type": "object",
        "required": [
          "status",
          "durationMs",
          "steps"
        ],
        "properties": {
          "status": {
            "enum": [
              "OPERATIONAL",
              "DEGRADED",
              "DOWN"
            ],
            "description": "FAIL em qualquer passo derruba; WARN ou SKIP viram operacional com limitações."
          },
          "durationMs": {
            "type": "integer"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HealthStep"
            }
          }
        }
      },
      "HealthStep": {
        "type": "object",
        "required": [
          "key",
          "label",
          "status",
          "detail",
          "durationMs"
        ],
        "properties": {
          "key": {
            "enum": [
              "endpoint",
              "api",
              "auth",
              "scopes",
              "read",
              "latency",
              "capabilities"
            ]
          },
          "label": {
            "type": "string"
          },
          "status": {
            "enum": [
              "PASS",
              "WARN",
              "FAIL",
              "SKIP"
            ]
          },
          "detail": {
            "type": "string",
            "description": "Frase para o operador. Nunca traz pilha, código cru nem segredo."
          },
          "durationMs": {
            "type": "integer"
          }
        }
      },
      "Logs": {
        "type": "object",
        "required": [
          "checks",
          "audit"
        ],
        "properties": {
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "status": {
                  "enum": [
                    "OPERATIONAL",
                    "DEGRADED",
                    "DOWN"
                  ]
                },
                "durationMs": {
                  "type": "integer"
                },
                "steps": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HealthStep"
                  }
                },
                "origin": {
                  "enum": [
                    "MANUAL",
                    "MONITOR"
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "audit": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "action": {
                  "type": "string"
                },
                "outcome": {
                  "type": "string"
                },
                "metadata": {
                  "type": "object"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "requestId": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "MonitorInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "intervalMinutes",
          "failureThreshold",
          "maxResponseMs"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "intervalMinutes": {
            "enum": [
              1,
              5,
              10,
              15,
              30
            ],
            "description": "Valor livre não é aceito: verificação de segundo em segundo contra o ERP de um cliente é abuso disfarçado de monitoramento."
          },
          "failureThreshold": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "description": "Falhas seguidas antes de abrir o incidente. É o que separa oscilação de queda."
          },
          "maxResponseMs": {
            "type": "integer",
            "minimum": 200,
            "maximum": 120000,
            "description": "Acima disso a verificação conta como falha, mesmo devolvendo 200."
          }
        }
      },
      "Monitor": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "intervalMinutes": {
            "type": "integer"
          },
          "failureThreshold": {
            "type": "integer"
          },
          "maxResponseMs": {
            "type": "integer"
          },
          "consecutiveFailures": {
            "type": "integer"
          },
          "alertState": {
            "enum": [
              "OK",
              "ALERTING"
            ]
          },
          "lastRunAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "nextRunAt": {
            "type": "string",
            "format": "date-time"
          },
          "incidentStartedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Alert": {
        "type": "object",
        "properties": {
          "alertType": {
            "enum": [
              "INTEGRATION_DOWN",
              "AUTH_FAILURE",
              "SLOW_API",
              "REPEATED_FAILURES",
              "RECOVERED"
            ]
          },
          "phase": {
            "enum": [
              "OPENED",
              "RECOVERED"
            ]
          },
          "status": {
            "enum": [
              "PENDING",
              "SENDING",
              "SENT",
              "FAILED",
              "UNKNOWN"
            ],
            "description": "UNKNOWN é entrega de resultado ambíguo e NÃO é reenviada: repetir alerta de madrugada é tão ruim quanto não avisar."
          },
          "channel": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "WHATSAPP",
              "EMAIL",
              null
            ]
          },
          "recipients": {
            "type": "integer"
          },
          "failureCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "sentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ChannelInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "revision"
        ],
        "description": "O NooriACS chama o HubOS, nunca a Evolution. Contrato: `POST {baseUrl}/api/public/whatsapp/send/{token}`.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "description": "Revisão otimista: o servidor recusa com 409 se a configuração mudou em outra aba."
          },
          "baseUrl": {
            "type": "string",
            "format": "uri",
            "description": "Origem do HubOS, HTTPS, sem usuário, senha, consulta ou âncora."
          },
          "token": {
            "type": "string",
            "description": "Chave de envio do HubOS. Vazio mantém a atual — ela nunca volta numa leitura."
          },
          "instanceId": {
            "type": "string"
          },
          "testNumber": {
            "type": "string"
          }
        }
      },
      "AlertSettings": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "object",
            "description": "O token nunca aparece aqui, só `tokenPreview`.",
            "properties": {
              "configured": {
                "type": "boolean"
              },
              "enabled": {
                "type": "boolean"
              },
              "revision": {
                "type": "integer"
              },
              "baseUrl": {
                "type": "string"
              },
              "instanceId": {
                "type": "string"
              },
              "testNumber": {
                "type": "string"
              },
              "tokenPreview": {
                "type": "string"
              },
              "lastTestedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "lastErrorCode": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "contrato": {
                "type": "string"
              }
            }
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "phone": {
                  "type": "string"
                },
                "label": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "preferences": {
            "type": "object",
            "properties": {
              "alerts": {
                "type": "object",
                "additionalProperties": {
                  "type": "boolean"
                }
              }
            }
          },
          "alertTypes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              }
            }
          },
          "maxPhones": {
            "type": "integer"
          },
          "canManageChannel": {
            "type": "boolean"
          }
        }
      },
      "SendOutcome": {
        "type": "object",
        "properties": {
          "status": {
            "enum": [
              "SENT",
              "FAILED",
              "PENDING",
              "UNKNOWN"
            ]
          },
          "code": {
            "type": "string"
          }
        }
      },
      "KeyPatch": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": false,
        "properties": {
          "integrator": {
            "type": "string",
            "pattern": "^[A-Za-z0-9 ._-]{2,64}$"
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "expiresInDays": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 730,
            "description": "Nulo passa a validade indeterminada."
          },
          "allowedCidrs": {
            "type": [
              "array",
              "string",
              "null"
            ],
            "description": "IPs e redes liberados, no máximo 20. Nulo, vazio ou lista vazia volta a liberar qualquer origem. Texto é aceito e separado por linha, vírgula ou ponto e vírgula.",
            "items": {
              "type": "string"
            }
          },
          "active": {
            "type": "boolean",
            "description": "Desativa ou reativa. Não serve para desfazer revogação."
          }
        }
      },
      "KeyView": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "integrator": {
            "type": "string"
          },
          "keyPrefix": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastUsedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "rotatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "allowedCidrs": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MeshFirmwareStep": {
        "type": "object",
        "required": [
          "deviceId",
          "parentId",
          "serialNumber",
          "firmwareId",
          "targetVersion",
          "alreadyCurrent"
        ],
        "properties": {
          "deviceId": {
            "type": "string",
            "format": "uuid"
          },
          "parentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "serialNumber": {
            "type": "string"
          },
          "firmwareId": {
            "type": "string",
            "format": "uuid"
          },
          "targetVersion": {
            "type": "string"
          },
          "alreadyCurrent": {
            "type": "boolean"
          }
        }
      },
      "MeshFirmwarePlan": {
        "type": "object",
        "required": [
          "hash",
          "steps"
        ],
        "properties": {
          "hash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "steps": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/MeshFirmwareStep"
            }
          }
        }
      },
      "MeshFields": {
        "type": "object",
        "properties": {
          "mesh_parent_device_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "mesh_evidence": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "parentDeviceId": {
                "type": "string"
              },
              "parentSerial": {
                "type": "string"
              },
              "childSerial": {
                "type": "string"
              },
              "observedAt": {
                "type": "string"
              },
              "expiresAt": {
                "type": "string"
              },
              "source": {
                "type": "string"
              },
              "backhaul": {
                "type": "string"
              }
            }
          }
        }
      },
      "Stage": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[A-Z0-9_]{1,40}$"
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "mode": {
            "enum": [
              "manual",
              "automatic",
              "hybrid"
            ]
          },
          "evidence": {
            "enum": [
              "NONE",
              "FIRST_INFORM",
              "ONLINE",
              "PROFILE_VALIDATED",
              "TASK_SUCCESS",
              "DIAGNOSTIC_SUCCESS",
              "FIRMWARE_SUCCESS",
              "BACKUP_SUCCESS",
              "CONFLICT_RESOLVED",
              "OFFLINE_15",
              "OFFLINE_60",
              "DOWNLOAD_STARTED",
              "REBOOT_OBSERVED",
              "VERSION_OBSERVED",
              "FAULT_RESOLVED"
            ]
          },
          "terminal": {
            "type": "boolean"
          }
        },
        "required": [
          "key",
          "name",
          "mode",
          "evidence",
          "terminal"
        ]
      },
      "TaskCreate": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 180
          },
          "description": {
            "type": "string",
            "maxLength": 8000
          },
          "type": {
            "enum": [
              "CONFIGURE_TR069",
              "FIRST_INFORM",
              "HUBSOFT_CONFLICT",
              "WEB_ACCESS",
              "DIAGNOSTIC",
              "OFFLINE",
              "WIFI_CHANGE",
              "REBOOT",
              "BACKUP",
              "BACKUP_VALIDATE",
              "FIRMWARE",
              "POST_UPGRADE",
              "ROLLBACK",
              "MODEL_APPROVAL",
              "PROFILE_VALIDATE",
              "SITE_SURVEY",
              "WIFI_INTERFERENCE",
              "CWMP_FAULT"
            ]
          },
          "priority": {
            "enum": [
              "LOW",
              "NORMAL",
              "HIGH",
              "CRITICAL"
            ]
          },
          "customerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "deviceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "workflowId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "assignedUserId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "assignedTeamId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "supervisorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "recurrenceMinutes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 60,
                "maximum": 525600
              },
              {
                "type": "null"
              }
            ]
          },
          "checklist": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "string",
              "maxLength": 300
            }
          },
          "watchers": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "resources": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "enum": [
                    "CUSTOMER",
                    "SERVICE",
                    "DEVICE",
                    "CAMPAIGN",
                    "FIRMWARE",
                    "BACKUP",
                    "PROFILE",
                    "FAULT",
                    "DIAGNOSTIC",
                    "DEVICE_TASK",
                    "WORKFLOW"
                  ]
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "kind",
                "id"
              ]
            }
          }
        },
        "required": [
          "title",
          "type"
        ]
      },
      "Task": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "type": {
            "enum": [
              "CONFIGURE_TR069",
              "FIRST_INFORM",
              "HUBSOFT_CONFLICT",
              "WEB_ACCESS",
              "DIAGNOSTIC",
              "OFFLINE",
              "WIFI_CHANGE",
              "REBOOT",
              "BACKUP",
              "BACKUP_VALIDATE",
              "FIRMWARE",
              "POST_UPGRADE",
              "ROLLBACK",
              "MODEL_APPROVAL",
              "PROFILE_VALIDATE",
              "SITE_SURVEY",
              "WIFI_INTERFERENCE",
              "CWMP_FAULT"
            ]
          },
          "status": {
            "enum": [
              "PENDING",
              "IN_PROGRESS",
              "WAITING_CPE",
              "WAITING_OPERATOR",
              "WAITING_APPROVAL",
              "BLOCKED",
              "COMPLETED",
              "FAILED",
              "CANCELED"
            ]
          },
          "priority": {
            "enum": [
              "LOW",
              "NORMAL",
              "HIGH",
              "CRITICAL"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "device_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "workflow_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "assigned_user_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "assigned_team_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "supervisor_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "stage_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "due_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "evidence_since": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "tenant_id",
          "title",
          "type",
          "status",
          "priority",
          "version"
        ]
      },
      "TaskPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Task"
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "page": {
                "type": "integer"
              },
              "hasNext": {
                "type": "boolean"
              }
            },
            "required": [
              "page",
              "hasNext"
            ]
          }
        },
        "required": [
          "items",
          "pagination"
        ]
      },
      "TaskMutation": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "enum": [
              "PENDING",
              "IN_PROGRESS",
              "WAITING_CPE",
              "WAITING_OPERATOR",
              "WAITING_APPROVAL",
              "BLOCKED",
              "COMPLETED",
              "FAILED",
              "CANCELED"
            ]
          },
          "stageKey": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "priority": {
            "enum": [
              "LOW",
              "NORMAL",
              "HIGH",
              "CRITICAL"
            ]
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "teamId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "supervisorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "userIds": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "itemId": {
            "type": "string",
            "format": "uuid"
          },
          "done": {
            "type": "boolean"
          },
          "body": {
            "type": "string",
            "maxLength": 4000
          },
          "mentions": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "kind": {
            "enum": [
              "CUSTOMER",
              "SERVICE",
              "DEVICE",
              "CAMPAIGN",
              "FIRMWARE",
              "BACKUP",
              "PROFILE",
              "FAULT",
              "DIAGNOSTIC",
              "DEVICE_TASK",
              "WORKFLOW"
            ]
          },
          "resourceId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "version"
        ]
      },
      "Workflow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "task_type": {
            "enum": [
              "CONFIGURE_TR069",
              "FIRST_INFORM",
              "HUBSOFT_CONFLICT",
              "WEB_ACCESS",
              "DIAGNOSTIC",
              "OFFLINE",
              "WIFI_CHANGE",
              "REBOOT",
              "BACKUP",
              "BACKUP_VALIDATE",
              "FIRMWARE",
              "POST_UPGRADE",
              "ROLLBACK",
              "MODEL_APPROVAL",
              "PROFILE_VALIDATE",
              "SITE_SURVEY",
              "WIFI_INTERFERENCE",
              "CWMP_FAULT"
            ]
          },
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Stage"
            }
          },
          "sla_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "version": {
            "type": "integer"
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "stages",
          "version"
        ]
      },
      "WorkflowInput": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[A-Z0-9_]{1,40}$"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "taskType": {
            "enum": [
              "CONFIGURE_TR069",
              "FIRST_INFORM",
              "HUBSOFT_CONFLICT",
              "WEB_ACCESS",
              "DIAGNOSTIC",
              "OFFLINE",
              "WIFI_CHANGE",
              "REBOOT",
              "BACKUP",
              "BACKUP_VALIDATE",
              "FIRMWARE",
              "POST_UPGRADE",
              "ROLLBACK",
              "MODEL_APPROVAL",
              "PROFILE_VALIDATE",
              "SITE_SURVEY",
              "WIFI_INTERFERENCE",
              "CWMP_FAULT"
            ]
          },
          "stages": {
            "type": "array",
            "minItems": 2,
            "maxItems": 30,
            "items": {
              "$ref": "#/components/schemas/Stage"
            }
          },
          "slaMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 525600
          },
          "version": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "name",
          "taskType",
          "stages"
        ]
      },
      "RuleInput": {
        "type": "object",
        "properties": {
          "eventType": {
            "enum": [
              "DEVICE_OFFLINE",
              "DEVICE_ONLINE",
              "FIRST_INFORM",
              "HUBSOFT_CONFLICT",
              "AWAITING_INFORM",
              "TASK_FAILED",
              "TASK_SUCCESS",
              "DIAGNOSTIC_SUCCESS",
              "FIRMWARE_SUCCESS",
              "MANUAL_BACKUP_VALIDATED",
              "MANUAL_BACKUP_REJECTED"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "priority": {
            "enum": [
              "LOW",
              "NORMAL",
              "HIGH",
              "CRITICAL"
            ]
          },
          "slaMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 525600
          }
        },
        "required": [
          "eventType",
          "enabled",
          "priority"
        ]
      },
      "TeamInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "members": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "active": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "name",
          "members"
        ]
      },
      "Team": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "version": {
            "type": "integer"
          },
          "members": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "id",
          "name",
          "version"
        ]
      },
      "Attachment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5242880
          }
        },
        "required": [
          "id",
          "filename",
          "mime_type",
          "size"
        ]
      },
      "Rule": {
        "type": "object",
        "required": [
          "id",
          "event_type",
          "enabled",
          "priority",
          "sla_minutes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "event_type": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "priority": {
            "type": "string"
          },
          "sla_minutes": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "ManualBackup": {
        "type": "object",
        "required": [
          "id",
          "status",
          "version"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "enum": [
              "STORED",
              "VALIDATED",
              "REJECTED"
            ]
          },
          "version": {
            "type": "integer"
          },
          "filename": {
            "type": "string"
          },
          "checksum_sha256": {
            "type": "string"
          },
          "source": {
            "const": "MANUAL_WEB"
          }
        },
        "description": "Metadados de exportação manual da Web da ONT. Conteúdo cifrado em S3, fora dos DTOs. Validação é atestação humana, não certificação automática de restauração."
      },
      "Network": {
        "type": "object",
        "required": [
          "ssid",
          "bssid",
          "radioId",
          "band",
          "channel",
          "frequencyMHz",
          "rssi",
          "widthMHz",
          "own"
        ],
        "properties": {
          "ssid": {
            "type": [
              "string",
              "null"
            ]
          },
          "bssid": {
            "type": [
              "string",
              "null"
            ]
          },
          "radioId": {
            "type": [
              "string",
              "null"
            ]
          },
          "security": {
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "collectedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel": {
            "type": [
              "number",
              "null"
            ]
          },
          "frequencyMHz": {
            "type": [
              "number",
              "null"
            ]
          },
          "rssi": {
            "type": [
              "number",
              "null"
            ]
          },
          "widthMHz": {
            "type": [
              "number",
              "null"
            ]
          },
          "noise": {
            "type": [
              "number",
              "null"
            ]
          },
          "snr": {
            "type": [
              "number",
              "null"
            ]
          },
          "utilization": {
            "type": [
              "number",
              "null"
            ]
          },
          "band": {
            "enum": [
              "2.4GHZ",
              "5GHZ",
              "6GHZ",
              null
            ]
          },
          "own": {
            "type": "boolean"
          }
        }
      },
      "History": {
        "type": "object",
        "required": [
          "deviceId",
          "customerId",
          "serviceId",
          "items"
        ],
        "properties": {
          "deviceId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "serviceId": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "View": {
        "type": "object",
        "required": [
          "deviceId",
          "customerId",
          "serviceId",
          "context",
          "capabilities",
          "availableActions",
          "radios",
          "networks",
          "latest",
          "analyses",
          "history",
          "active"
        ],
        "properties": {
          "networks": {
            "type": "array",
            "maxItems": 512,
            "items": {
              "$ref": "#/components/schemas/Network"
            }
          },
          "latest": {
            "type": [
              "object",
              "null"
            ]
          },
          "active": {
            "type": [
              "object",
              "null"
            ]
          },
          "radios": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "analyses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "interferenceScore": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100
                },
                "historical": {
                  "type": "boolean"
                },
                "recommendedChannel": {
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              }
            }
          },
          "canRefreshCapabilities": {
            "type": "boolean"
          },
          "channelOperations": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "radioId",
                "channel",
                "previousChannel",
                "status"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "radioId": {
                  "type": "string"
                },
                "channel": {
                  "type": "integer"
                },
                "previousChannel": {
                  "type": "integer"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "PENDING",
                    "RETRY",
                    "DISPATCHED",
                    "STABILIZING",
                    "SCANNING",
                    "COMPLETED",
                    "FAILED",
                    "EXPIRED",
                    "CANCELED"
                  ]
                },
                "beforeScore": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "afterScore": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "error": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "x-noori-product": "NOORI_ACS",
  "x-noori-api-version": "v1",
  "x-noori-system-version": "2026.11.15-retencao.3",
  "x-noori-environment": "PRODUCTION",
  "x-noori-base-url": "https://nooriacs.hosthub.net.br/api/v1",
  "x-noori-contracts": [
    {
      "file": "account-security-v1.openapi.json",
      "name": "account security",
      "format": "json",
      "url": "/docs/contracts/account-security-v1.openapi.json",
      "merged": true
    },
    {
      "file": "acs-settings-v1.openapi.json",
      "name": "acs settings",
      "format": "json",
      "url": "/docs/contracts/acs-settings-v1.openapi.json",
      "merged": true
    },
    {
      "file": "automatic-wan-v1.openapi.json",
      "name": "automatic wan",
      "format": "json",
      "url": "/docs/contracts/automatic-wan-v1.openapi.json",
      "merged": true
    },
    {
      "file": "control-plane-v1.openapi.yaml",
      "name": "control plane",
      "format": "yaml",
      "url": "/docs/contracts/control-plane-v1.openapi.yaml",
      "merged": false
    },
    {
      "file": "cpe-profile-compatibility-v1.openapi.json",
      "name": "cpe profile compatibility",
      "format": "json",
      "url": "/docs/contracts/cpe-profile-compatibility-v1.openapi.json",
      "merged": true
    },
    {
      "file": "cpe-profile-images-v1.openapi.yaml",
      "name": "cpe profile images",
      "format": "yaml",
      "url": "/docs/contracts/cpe-profile-images-v1.openapi.yaml",
      "merged": false
    },
    {
      "file": "customer-total-visibility-v1.openapi.json",
      "name": "customer total visibility",
      "format": "json",
      "url": "/docs/contracts/customer-total-visibility-v1.openapi.json",
      "merged": true
    },
    {
      "file": "dashboard-v1.openapi.json",
      "name": "dashboard",
      "format": "json",
      "url": "/docs/contracts/dashboard-v1.openapi.json",
      "merged": true
    },
    {
      "file": "device-integration-v1.openapi.json",
      "name": "device integration",
      "format": "json",
      "url": "/docs/contracts/device-integration-v1.openapi.json",
      "merged": true
    },
    {
      "file": "device-operations-v1.openapi.yaml",
      "name": "device operations",
      "format": "yaml",
      "url": "/docs/contracts/device-operations-v1.openapi.yaml",
      "merged": false
    },
    {
      "file": "hubsoft-mac-v1.openapi.json",
      "name": "hubsoft mac",
      "format": "json",
      "url": "/docs/contracts/hubsoft-mac-v1.openapi.json",
      "merged": true
    },
    {
      "file": "hubsoft-subscriber-session-v1.openapi.yaml",
      "name": "hubsoft subscriber session",
      "format": "yaml",
      "url": "/docs/contracts/hubsoft-subscriber-session-v1.openapi.yaml",
      "merged": false
    },
    {
      "file": "integration-center-v1.openapi.json",
      "name": "integration center",
      "format": "json",
      "url": "/docs/contracts/integration-center-v1.openapi.json",
      "merged": true
    },
    {
      "file": "integration-settings-v1.openapi.yaml",
      "name": "integration settings",
      "format": "yaml",
      "url": "/docs/contracts/integration-settings-v1.openapi.yaml",
      "merged": false
    },
    {
      "file": "mesh-firmware-v1.openapi.json",
      "name": "mesh firmware",
      "format": "json",
      "url": "/docs/contracts/mesh-firmware-v1.openapi.json",
      "merged": true
    },
    {
      "file": "mesh-v1.openapi.json",
      "name": "mesh",
      "format": "json",
      "url": "/docs/contracts/mesh-v1.openapi.json",
      "merged": true
    },
    {
      "file": "operational-workflows-v1.openapi.json",
      "name": "operational workflows",
      "format": "json",
      "url": "/docs/contracts/operational-workflows-v1.openapi.json",
      "merged": true
    },
    {
      "file": "platform-monthly-billing-v1.openapi.yaml",
      "name": "platform monthly billing",
      "format": "yaml",
      "url": "/docs/contracts/platform-monthly-billing-v1.openapi.yaml",
      "merged": false
    },
    {
      "file": "platform-operating-company-v1.openapi.yaml",
      "name": "platform operating company",
      "format": "yaml",
      "url": "/docs/contracts/platform-operating-company-v1.openapi.yaml",
      "merged": false
    },
    {
      "file": "platform-payment-provider-v1.openapi.yaml",
      "name": "platform payment provider",
      "format": "yaml",
      "url": "/docs/contracts/platform-payment-provider-v1.openapi.yaml",
      "merged": false
    },
    {
      "file": "platform-saas-provisioning-v1.openapi.json",
      "name": "platform saas provisioning",
      "format": "json",
      "url": "/docs/contracts/platform-saas-provisioning-v1.openapi.json",
      "merged": true
    },
    {
      "file": "provisioning-resources-v1.openapi.yaml",
      "name": "provisioning resources",
      "format": "yaml",
      "url": "/docs/contracts/provisioning-resources-v1.openapi.yaml",
      "merged": false
    },
    {
      "file": "wifi-site-survey-v1.openapi.json",
      "name": "wifi site survey",
      "format": "json",
      "url": "/docs/contracts/wifi-site-survey-v1.openapi.json",
      "merged": true
    }
  ]
}