{
  "openapi": "3.0.3",
  "servers": [
    {
      "url": "https://api.cotejar.com.br",
      "description": "Produção"
    }
  ],
  "info": {
    "title": "API Cotejar",
    "description": "Integração autenticada e idempotente com catálogos de produtos.",
    "version": "1.0.0"
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Credencial criada no painel da empresa. O segredo é exibido uma única vez."
      }
    },
    "schemas": {}
  },
  "tags": [
    {
      "name": "Conta e empresa",
      "description": "Contexto empresarial da integração."
    },
    {
      "name": "Catálogos",
      "description": "Consulta de catálogos e ingestão de produtos."
    },
    {
      "name": "Produtos",
      "description": "Consulta, criação e edição de produtos."
    },
    {
      "name": "Estabelecimentos",
      "description": "Consulta de matriz e filiais da empresa."
    },
    {
      "name": "Vigilância",
      "description": "Seleção e capacidade compartilhadas entre catálogos."
    },
    {
      "name": "Webhooks",
      "description": "Configuração e revogação do destino de eventos da empresa."
    },
    {
      "name": "Análises",
      "description": "Aceite durável e resultados completos da análise."
    }
  ],
  "paths": {
    "/v1/catalogos/ingestoes": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Iniciar ingestão no catálogo selecionado",
        "tags": [
          "Catálogos"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "operacao"
                ],
                "properties": {
                  "operacao": {
                    "type": "string",
                    "enum": [
                      "mesclar",
                      "substituicao_catalogo",
                      "substituicao_integral"
                    ]
                  },
                  "catalogo_id": {
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "Identificador UUID da ingestão.",
                    "type": "string"
                  },
                  "referencia_externa": {
                    "minLength": 1,
                    "maxLength": 200,
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ingestao_id",
                    "estado",
                    "repetida"
                  ],
                  "properties": {
                    "ingestao_id": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string"
                    },
                    "repetida": {
                      "type": "boolean"
                    },
                    "catalogo_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "Identificador UUID da ingestão.",
                      "type": "string"
                    },
                    "versao_catalogo": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Response for status 201",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ingestao_id",
                    "estado",
                    "repetida"
                  ],
                  "properties": {
                    "ingestao_id": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string"
                    },
                    "repetida": {
                      "type": "boolean"
                    },
                    "catalogo_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "Identificador UUID da ingestão.",
                      "type": "string"
                    },
                    "versao_catalogo": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 200,
              "pattern": "^\\S+$",
              "type": "string"
            }
          }
        ],
        "operationId": "postV1CatalogosIngestoes"
      }
    },
    "/v1/catalogos/ingestoes/{id}/lotes/{sequencia}": {
      "put": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Enviar lote canônico",
        "tags": [
          "Catálogos"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "produtos"
                ],
                "properties": {
                  "produtos": {
                    "minItems": 1,
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "codigo_cliente": {
                          "minLength": 1,
                          "maxLength": 256,
                          "type": "string"
                        },
                        "descricao_cliente": {
                          "minLength": 1,
                          "maxLength": 2000,
                          "type": "string"
                        },
                        "ncm": {
                          "pattern": "^[0-9]{8}$",
                          "type": "string"
                        },
                        "desativado_por_ato": {
                          "type": "boolean"
                        },
                        "atributos": {
                          "maxItems": 128,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "codigo",
                              "valores"
                            ],
                            "properties": {
                              "codigo": {
                                "pattern": "^ATT_[0-9]+$",
                                "maxLength": 64,
                                "type": "string"
                              },
                              "valores": {
                                "minItems": 1,
                                "maxItems": 50,
                                "type": "array",
                                "items": {
                                  "minLength": 1,
                                  "maxLength": 1000,
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Resposta HTTP 200.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ingestao_id",
                    "sequencia",
                    "produtos_recebidos",
                    "repetido"
                  ],
                  "properties": {
                    "ingestao_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "Identificador UUID da ingestão.",
                      "type": "string"
                    },
                    "sequencia": {
                      "minimum": 1,
                      "maximum": 10000,
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "minimum": 1,
                          "maximum": 10000,
                          "type": "integer"
                        }
                      ]
                    },
                    "produtos_recebidos": {
                      "minimum": 1,
                      "maximum": 200,
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "minimum": 1,
                          "maximum": 200,
                          "type": "integer"
                        }
                      ]
                    },
                    "repetido": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Resposta HTTP 201.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ingestao_id",
                    "sequencia",
                    "produtos_recebidos",
                    "repetido"
                  ],
                  "properties": {
                    "ingestao_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "Identificador UUID da ingestão.",
                      "type": "string"
                    },
                    "sequencia": {
                      "minimum": 1,
                      "maximum": 10000,
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "minimum": 1,
                          "maximum": 10000,
                          "type": "integer"
                        }
                      ]
                    },
                    "produtos_recebidos": {
                      "minimum": 1,
                      "maximum": 200,
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "minimum": 1,
                          "maximum": 200,
                          "type": "integer"
                        }
                      ]
                    },
                    "repetido": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resposta HTTP 400.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Resposta HTTP 401.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Resposta HTTP 403.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resposta HTTP 404.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Resposta HTTP 408.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Resposta HTTP 409.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Resposta HTTP 413.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Resposta HTTP 415.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Resposta HTTP 422.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Resposta HTTP 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Resposta HTTP 503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "description": "Identificador UUID da ingestão.",
              "type": "string"
            }
          },
          {
            "name": "sequencia",
            "in": "path",
            "required": true,
            "schema": {
              "minimum": 1,
              "maximum": 10000,
              "anyOf": [
                {
                  "format": "numeric",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 10000,
                  "type": "number"
                }
              ]
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 200,
              "pattern": "^\\S+$",
              "type": "string"
            }
          }
        ],
        "operationId": "putV1CatalogosIngestoesByIdLotesBySequencia"
      }
    },
    "/v1/catalogos/ingestoes/{id}/validar": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Fechar lotes e validar a prévia",
        "tags": [
          "Catálogos"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ultima_sequencia"
                ],
                "properties": {
                  "ultima_sequencia": {
                    "minimum": 1,
                    "maximum": 10000,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer"
                      }
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Resposta HTTP 200.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ingestao_id",
                    "estado",
                    "hash_previa",
                    "totais",
                    "guardas"
                  ],
                  "properties": {
                    "ingestao_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "Identificador UUID da ingestão.",
                      "type": "string"
                    },
                    "estado": {
                      "anyOf": [
                        {
                          "const": "precisa_revisao",
                          "type": "string"
                        },
                        {
                          "const": "pronta_para_aplicar",
                          "type": "string"
                        }
                      ]
                    },
                    "hash_previa": {
                      "pattern": "^[0-9a-f]{64}$",
                      "description": "Resumo SHA-256 em hexadecimal minúsculo.",
                      "type": "string"
                    },
                    "totais": {
                      "type": "object",
                      "required": [
                        "lotes",
                        "produtos",
                        "incompletos",
                        "atributos"
                      ],
                      "properties": {
                        "lotes": {
                          "minimum": 1,
                          "maximum": 10000,
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "minimum": 1,
                              "maximum": 10000,
                              "type": "integer"
                            }
                          ]
                        },
                        "produtos": {
                          "minimum": 1,
                          "maximum": 50000,
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "minimum": 1,
                              "maximum": 50000,
                              "type": "integer"
                            }
                          ]
                        },
                        "incompletos": {
                          "minimum": 0,
                          "maximum": 50000,
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "minimum": 0,
                              "maximum": 50000,
                              "type": "integer"
                            }
                          ]
                        },
                        "atributos": {
                          "minimum": 0,
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "minimum": 0,
                              "type": "integer"
                            }
                          ]
                        }
                      }
                    },
                    "guardas": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resposta HTTP 400.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Resposta HTTP 401.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Resposta HTTP 403.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resposta HTTP 404.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Resposta HTTP 408.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Resposta HTTP 409.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Resposta HTTP 413.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Resposta HTTP 415.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Resposta HTTP 422.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Resposta HTTP 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Resposta HTTP 503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "description": "Identificador UUID da ingestão.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 200,
              "pattern": "^\\S+$",
              "type": "string"
            }
          }
        ],
        "operationId": "postV1CatalogosIngestoesByIdValidar"
      }
    },
    "/v1/catalogos/ingestoes/{id}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Consultar ingestão e prévia",
        "tags": [
          "Catálogos"
        ],
        "responses": {
          "200": {
            "description": "Resposta HTTP 200.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ingestao_id",
                    "canal",
                    "estado",
                    "hash_previa",
                    "codigo_falha",
                    "classificacao",
                    "totais",
                    "guardas",
                    "itens",
                    "criado_em",
                    "atualizado_em",
                    "aplicada_em"
                  ],
                  "properties": {
                    "ingestao_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "Identificador UUID da ingestão.",
                      "type": "string"
                    },
                    "catalogo_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "Identificador UUID da ingestão.",
                      "type": "string"
                    },
                    "versao_catalogo": {
                      "minimum": 1,
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "minimum": 1,
                          "type": "integer"
                        }
                      ]
                    },
                    "operacao": {
                      "anyOf": [
                        {
                          "const": "mesclar",
                          "type": "string"
                        },
                        {
                          "const": "substituicao_catalogo",
                          "type": "string"
                        }
                      ]
                    },
                    "canal": {
                      "type": "string"
                    },
                    "estado": {
                      "anyOf": [
                        {
                          "const": "recebida",
                          "type": "string"
                        },
                        {
                          "const": "recebendo_lotes",
                          "type": "string"
                        },
                        {
                          "const": "validando",
                          "type": "string"
                        },
                        {
                          "const": "extraindo",
                          "type": "string"
                        },
                        {
                          "const": "classificando",
                          "type": "string"
                        },
                        {
                          "const": "normalizada",
                          "type": "string"
                        },
                        {
                          "const": "precisa_revisao",
                          "type": "string"
                        },
                        {
                          "const": "pronta_para_aplicar",
                          "type": "string"
                        },
                        {
                          "const": "aplicando",
                          "type": "string"
                        },
                        {
                          "const": "aplicada",
                          "type": "string"
                        },
                        {
                          "const": "cancelada",
                          "type": "string"
                        },
                        {
                          "const": "recusada_formato",
                          "type": "string"
                        },
                        {
                          "const": "recusada_conteudo",
                          "type": "string"
                        },
                        {
                          "const": "falhou_extracao",
                          "type": "string"
                        },
                        {
                          "const": "falhou_modelo",
                          "type": "string"
                        },
                        {
                          "const": "falhou_validacao",
                          "type": "string"
                        },
                        {
                          "const": "falhou_aplicacao",
                          "type": "string"
                        }
                      ]
                    },
                    "hash_previa": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "pattern": "^[0-9a-f]{64}$",
                          "description": "Resumo SHA-256 em hexadecimal minúsculo.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "progresso_aplicacao": {
                      "type": "object",
                      "required": [
                        "fase",
                        "itens_preparados",
                        "itens_previstos"
                      ],
                      "properties": {
                        "fase": {
                          "anyOf": [
                            {
                              "const": "preparando",
                              "type": "string"
                            },
                            {
                              "const": "conferindo",
                              "type": "string"
                            },
                            {
                              "const": "concluida",
                              "type": "string"
                            },
                            {
                              "const": "interrompida",
                              "type": "string"
                            }
                          ]
                        },
                        "itens_preparados": {
                          "minimum": 0,
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "minimum": 0,
                              "type": "integer"
                            }
                          ]
                        },
                        "itens_previstos": {
                          "minimum": 0,
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "minimum": 0,
                              "type": "integer"
                            }
                          ]
                        }
                      }
                    },
                    "codigo_falha": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "classificacao": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totais": {
                      "type": "object",
                      "required": [
                        "linhas",
                        "produtos",
                        "incompletos",
                        "recusados",
                        "atributos"
                      ],
                      "properties": {
                        "linhas": {
                          "nullable": true,
                          "anyOf": [
                            {
                              "minimum": 0,
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "minimum": 0,
                                  "type": "integer"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "produtos": {
                          "nullable": true,
                          "anyOf": [
                            {
                              "minimum": 0,
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "minimum": 0,
                                  "type": "integer"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "incompletos": {
                          "nullable": true,
                          "anyOf": [
                            {
                              "minimum": 0,
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "minimum": 0,
                                  "type": "integer"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "recusados": {
                          "nullable": true,
                          "anyOf": [
                            {
                              "minimum": 0,
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "minimum": 0,
                                  "type": "integer"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "atributos": {
                          "nullable": true,
                          "anyOf": [
                            {
                              "minimum": 0,
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "minimum": 0,
                                  "type": "integer"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    },
                    "guardas": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id_temporario",
                          "codigo_cliente",
                          "descricao_cliente",
                          "ncm",
                          "posicao",
                          "erros"
                        ],
                        "properties": {
                          "id_temporario": {
                            "type": "string"
                          },
                          "codigo_cliente": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "descricao_cliente": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ncm": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "posicao": {
                            "minimum": 1,
                            "anyOf": [
                              {
                                "format": "integer",
                                "default": 0,
                                "type": "string"
                              },
                              {
                                "minimum": 1,
                                "type": "integer"
                              }
                            ]
                          },
                          "erros": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "criado_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "atualizado_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "aplicada_em": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "format": "date-time",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Resposta HTTP 401.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Resposta HTTP 403.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resposta HTTP 404.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Resposta HTTP 422.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Resposta HTTP 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Resposta HTTP 503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "description": "Identificador UUID da ingestão.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getV1CatalogosIngestoesById"
      }
    },
    "/v1/catalogos/ingestoes/{id}/aplicar": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Agendar aplicação da prévia validada",
        "tags": [
          "Catálogos"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "hash_previa"
                ],
                "properties": {
                  "hash_previa": {
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "Resumo SHA-256 em hexadecimal minúsculo.",
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Resposta HTTP 200.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ingestao_id",
                    "estado",
                    "repetida"
                  ],
                  "properties": {
                    "ingestao_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "Identificador UUID da ingestão.",
                      "type": "string"
                    },
                    "estado": {
                      "anyOf": [
                        {
                          "const": "aplicando",
                          "type": "string"
                        },
                        {
                          "const": "aplicada",
                          "type": "string"
                        }
                      ]
                    },
                    "repetida": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Caminho da consulta da ingestão. Aceite não comprova aplicação concluída.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "description": "Resposta HTTP 202.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ingestao_id",
                    "estado",
                    "repetida"
                  ],
                  "properties": {
                    "ingestao_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "Identificador UUID da ingestão.",
                      "type": "string"
                    },
                    "estado": {
                      "anyOf": [
                        {
                          "const": "aplicando",
                          "type": "string"
                        },
                        {
                          "const": "aplicada",
                          "type": "string"
                        }
                      ]
                    },
                    "repetida": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Caminho da consulta da ingestão. Aceite não comprova aplicação concluída.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Resposta HTTP 400.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Resposta HTTP 401.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Resposta HTTP 403.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resposta HTTP 404.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Resposta HTTP 408.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Resposta HTTP 409.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Resposta HTTP 413.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Resposta HTTP 415.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Resposta HTTP 422.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Resposta HTTP 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Resposta HTTP 503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "description": "Identificador UUID da ingestão.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 200,
              "pattern": "^\\S+$",
              "type": "string"
            }
          }
        ],
        "operationId": "postV1CatalogosIngestoesByIdAplicar"
      }
    },
    "/v1/webhook/eventos": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Webhooks"
        ],
        "summary": "Listar eventos e estado das entregas",
        "description": "Exige webhook:gerenciar. Mais recentes primeiro, até 100 eventos e orçamento de 1 MiB por página. Cursor opaco da mesma empresa. Consulta permitida após suspensão.",
        "parameters": [
          {
            "name": "limite",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$",
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 2048,
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "itens",
                    "proximo_cursor"
                  ],
                  "properties": {
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "tipo",
                          "ocorrido_em",
                          "destino_id",
                          "destino_versao",
                          "estado",
                          "tentativas_ciclo",
                          "tentativas_totais",
                          "criado_em",
                          "terminado_em",
                          "proxima_tentativa_em",
                          "prazo_em",
                          "codigo_falha",
                          "status_http"
                        ],
                        "properties": {
                          "id": {
                            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                            "type": "string"
                          },
                          "tipo": {
                            "type": "string",
                            "enum": [
                              "catalogo.aplicado",
                              "catalogo.revisao_necessaria",
                              "analise.concluida",
                              "analise.falhou",
                              "divergencias.alteradas",
                              "vigilancia.degradada",
                              "vigilancia.restabelecida",
                              "webhook.teste"
                            ]
                          },
                          "ocorrido_em": {
                            "type": "string"
                          },
                          "destino_id": {
                            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                            "type": "string"
                          },
                          "destino_versao": {
                            "anyOf": [
                              {
                                "format": "integer",
                                "default": 0,
                                "type": "string"
                              },
                              {
                                "type": "integer"
                              }
                            ]
                          },
                          "estado": {
                            "type": "string",
                            "enum": [
                              "pendente",
                              "executando",
                              "entregue",
                              "falhou",
                              "cancelado"
                            ]
                          },
                          "tentativas_ciclo": {
                            "anyOf": [
                              {
                                "format": "integer",
                                "default": 0,
                                "type": "string"
                              },
                              {
                                "type": "integer"
                              }
                            ]
                          },
                          "tentativas_totais": {
                            "anyOf": [
                              {
                                "format": "integer",
                                "default": 0,
                                "type": "string"
                              },
                              {
                                "type": "integer"
                              }
                            ]
                          },
                          "criado_em": {
                            "type": "string"
                          },
                          "terminado_em": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "proxima_tentativa_em": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "prazo_em": {
                            "type": "string"
                          },
                          "codigo_falha": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "status_http": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "format": "integer",
                                    "default": 0,
                                    "type": "string"
                                  },
                                  {
                                    "type": "integer"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      }
                    },
                    "proximo_cursor": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1WebhookEventos"
      }
    },
    "/v1/webhook/eventos/{id}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Webhooks"
        ],
        "summary": "Consultar evento e situação da entrega",
        "description": "Inclui o envelope original assinado e metadados sanitizados. Não retorna segredo nem resposta do receptor.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "tipo",
                    "ocorrido_em",
                    "destino_id",
                    "destino_versao",
                    "estado",
                    "tentativas_ciclo",
                    "tentativas_totais",
                    "criado_em",
                    "terminado_em",
                    "proxima_tentativa_em",
                    "prazo_em",
                    "codigo_falha",
                    "status_http",
                    "evento"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                      "type": "string"
                    },
                    "tipo": {
                      "type": "string",
                      "enum": [
                        "catalogo.aplicado",
                        "catalogo.revisao_necessaria",
                        "analise.concluida",
                        "analise.falhou",
                        "divergencias.alteradas",
                        "vigilancia.degradada",
                        "vigilancia.restabelecida",
                        "webhook.teste"
                      ]
                    },
                    "ocorrido_em": {
                      "type": "string"
                    },
                    "destino_id": {
                      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                      "type": "string"
                    },
                    "destino_versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "pendente",
                        "executando",
                        "entregue",
                        "falhou",
                        "cancelado"
                      ]
                    },
                    "tentativas_ciclo": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "tentativas_totais": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "criado_em": {
                      "type": "string"
                    },
                    "terminado_em": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "proxima_tentativa_em": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "prazo_em": {
                      "type": "string"
                    },
                    "codigo_falha": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status_http": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "evento": {
                      "type": "object",
                      "required": [
                        "id",
                        "versao",
                        "empresa",
                        "ocorridoEm",
                        "dados"
                      ],
                      "properties": {
                        "id": {
                          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                          "type": "string"
                        },
                        "versao": {
                          "const": 1,
                          "type": "number"
                        },
                        "empresa": {
                          "pattern": "^[0-9]{8}$",
                          "type": "string"
                        },
                        "ocorridoEm": {
                          "type": "string"
                        },
                        "dados": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "tipo",
                                "catalogoId",
                                "versao"
                              ],
                              "properties": {
                                "tipo": {
                                  "const": "catalogo.aplicado",
                                  "type": "string"
                                },
                                "catalogoId": {
                                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                  "type": "string"
                                },
                                "versao": {
                                  "minimum": 1,
                                  "anyOf": [
                                    {
                                      "format": "integer",
                                      "default": 0,
                                      "type": "string"
                                    },
                                    {
                                      "minimum": 1,
                                      "type": "integer"
                                    }
                                  ]
                                }
                              }
                            },
                            {
                              "type": "object",
                              "required": [
                                "tipo",
                                "catalogoId",
                                "ingestaoId"
                              ],
                              "properties": {
                                "tipo": {
                                  "const": "catalogo.revisao_necessaria",
                                  "type": "string"
                                },
                                "catalogoId": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "ingestaoId": {
                                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                  "type": "string"
                                }
                              }
                            },
                            {
                              "type": "object",
                              "required": [
                                "tipo",
                                "analiseId",
                                "regulamentoDegradado"
                              ],
                              "properties": {
                                "tipo": {
                                  "const": "analise.concluida",
                                  "type": "string"
                                },
                                "analiseId": {
                                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                  "type": "string"
                                },
                                "regulamentoDegradado": {
                                  "type": "boolean"
                                }
                              }
                            },
                            {
                              "type": "object",
                              "required": [
                                "tipo",
                                "analiseId"
                              ],
                              "properties": {
                                "tipo": {
                                  "const": "analise.falhou",
                                  "type": "string"
                                },
                                "analiseId": {
                                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                  "type": "string"
                                }
                              }
                            },
                            {
                              "type": "object",
                              "required": [
                                "tipo",
                                "vigilanciaId",
                                "novas",
                                "reabertas",
                                "resolvidas"
                              ],
                              "properties": {
                                "tipo": {
                                  "const": "divergencias.alteradas",
                                  "type": "string"
                                },
                                "vigilanciaId": {
                                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                  "type": "string"
                                },
                                "novas": {
                                  "minimum": 0,
                                  "anyOf": [
                                    {
                                      "format": "integer",
                                      "default": 0,
                                      "type": "string"
                                    },
                                    {
                                      "minimum": 0,
                                      "type": "integer"
                                    }
                                  ]
                                },
                                "reabertas": {
                                  "minimum": 0,
                                  "anyOf": [
                                    {
                                      "format": "integer",
                                      "default": 0,
                                      "type": "string"
                                    },
                                    {
                                      "minimum": 0,
                                      "type": "integer"
                                    }
                                  ]
                                },
                                "resolvidas": {
                                  "minimum": 0,
                                  "anyOf": [
                                    {
                                      "format": "integer",
                                      "default": 0,
                                      "type": "string"
                                    },
                                    {
                                      "minimum": 0,
                                      "type": "integer"
                                    }
                                  ]
                                }
                              }
                            },
                            {
                              "type": "object",
                              "required": [
                                "tipo",
                                "ultimaVarreduraEm",
                                "ultimaColetaUtilEm",
                                "varreduraVencida",
                                "regulamentoDegradado"
                              ],
                              "properties": {
                                "tipo": {
                                  "anyOf": [
                                    {
                                      "const": "vigilancia.degradada",
                                      "type": "string"
                                    },
                                    {
                                      "const": "vigilancia.restabelecida",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "ultimaVarreduraEm": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "format": "date-time",
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "ultimaColetaUtilEm": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "format": "date-time",
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "varreduraVencida": {
                                  "type": "boolean"
                                },
                                "regulamentoDegradado": {
                                  "type": "boolean"
                                }
                              }
                            },
                            {
                              "type": "object",
                              "required": [
                                "tipo",
                                "destinoId"
                              ],
                              "properties": {
                                "tipo": {
                                  "const": "webhook.teste",
                                  "type": "string"
                                },
                                "destinoId": {
                                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                  "type": "string"
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1WebhookEventosById"
      }
    },
    "/v1/webhook/eventos/{id}/tentativas": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Webhooks"
        ],
        "summary": "Consultar tentativas do evento",
        "description": "Ordem crescente de tentativa; padrão 50, máximo 100. proxima_tentativa deve ser enviada como apos_tentativa. Preserva tentativas de ciclos anteriores.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "limite",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$",
              "type": "string"
            }
          },
          {
            "name": "apos_tentativa",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[0-9]{1,10}$",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "itens",
                    "proxima_tentativa"
                  ],
                  "properties": {
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "tentativa",
                          "destino_versao",
                          "estado",
                          "iniciada_em",
                          "terminada_em",
                          "codigo_falha",
                          "status_http"
                        ],
                        "properties": {
                          "tentativa": {
                            "anyOf": [
                              {
                                "format": "integer",
                                "default": 0,
                                "type": "string"
                              },
                              {
                                "type": "integer"
                              }
                            ]
                          },
                          "destino_versao": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "format": "integer",
                                    "default": 0,
                                    "type": "string"
                                  },
                                  {
                                    "type": "integer"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "estado": {
                            "type": "string",
                            "enum": [
                              "iniciada",
                              "entregue",
                              "falhou",
                              "incerta"
                            ]
                          },
                          "iniciada_em": {
                            "type": "string"
                          },
                          "terminada_em": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "codigo_falha": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "status_http": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "format": "integer",
                                    "default": 0,
                                    "type": "string"
                                  },
                                  {
                                    "type": "integer"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      }
                    },
                    "proxima_tentativa": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1WebhookEventosByIdTentativas"
      }
    },
    "/v1/webhook/testes": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Caminho da consulta do recurso criado ou da operação aceita. Aceite não comprova conclusão."
              }
            },
            "description": "Response for status 202",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "evento_id",
                    "destino_id",
                    "destino_versao",
                    "estado"
                  ],
                  "properties": {
                    "evento_id": {
                      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                      "type": "string"
                    },
                    "destino_id": {
                      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                      "type": "string"
                    },
                    "destino_versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "estado": {
                      "const": "aceito",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Webhooks"
        ],
        "summary": "Agendar evento de teste",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        },
        "description": "Exige assinatura ativa, webhook:gerenciar, ETag atual do destino e idempotência. Testes e reenvios compartilham teto de 5 pedidos/minuto por empresa. 202 confirma aceite na fila, não sucesso da conexão.",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "postV1WebhookTestes"
      }
    },
    "/v1/webhook/eventos/{id}/reenvios": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Caminho da consulta do recurso criado ou da operação aceita. Aceite não comprova conclusão."
              }
            },
            "description": "Response for status 202",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "evento_id",
                    "destino_id",
                    "destino_versao",
                    "estado"
                  ],
                  "properties": {
                    "evento_id": {
                      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                      "type": "string"
                    },
                    "destino_id": {
                      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                      "type": "string"
                    },
                    "destino_versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "estado": {
                      "const": "aceito",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Webhooks"
        ],
        "summary": "Agendar reenvio de evento encerrado",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        },
        "description": "Exige assinatura ativa, webhook:gerenciar, ETag atual do destino e idempotência. Evento de até 30 dias; entregue, falhou ou cancelado. Abre ciclo de até 8 tentativas/24 h, preservando ID/corpo e histórico. Autoriza explicitamente o destino atual, inclusive após rotação. Sem cobrança por evento.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "postV1WebhookEventosByIdReenvios"
      }
    },
    "/v1/webhook": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "versao",
                    "estado",
                    "url"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "ativo",
                        "revogado"
                      ]
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Webhooks"
        ],
        "summary": "Consultar configuração do webhook",
        "description": "Exige webhook:gerenciar. Não retorna segredo. A configuração pertence à empresa da chave, inclusive após suspensão da assinatura.",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getV1Webhook"
      },
      "put": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              },
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Caminho da consulta do recurso criado ou da operação aceita. Aceite não comprova conclusão."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "versao",
                    "estado",
                    "url",
                    "segredo"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "estado": {
                      "const": "ativo",
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "segredo": {
                      "description": "Guarde com segurança; exibido nesta operação e em sua repetição idempotente.",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              },
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Caminho da consulta do recurso criado ou da operação aceita. Aceite não comprova conclusão."
              }
            },
            "description": "Response for status 201",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "versao",
                    "estado",
                    "url",
                    "segredo"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "estado": {
                      "const": "ativo",
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "segredo": {
                      "description": "Guarde com segurança; exibido nesta operação e em sua repetição idempotente.",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Webhooks"
        ],
        "summary": "Configurar ou rotacionar webhook",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "description": "HTTPS público na porta 443, sem credenciais ou fragmento."
                  }
                }
              }
            }
          }
        },
        "description": "Exige webhook:gerenciar e assinatura ativa. Corpo até 4 KiB. Crie com If-None-Match: *; altere com If-Match. Cada alteração gera novo segredo e invalida entregas da versão anterior. ETag identifica a configuração consultável. Repetição devolve o recibo original e não reativa destino revogado.",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": false,
            "schema": {
              "description": "ETag completo da configuração atual; obrigatório para alterar ou reativar.",
              "type": "string"
            }
          },
          {
            "name": "if-none-match",
            "in": "header",
            "required": false,
            "schema": {
              "description": "Use * somente para criar. Não combine com If-Match.",
              "type": "string"
            }
          }
        ],
        "operationId": "putV1Webhook"
      },
      "delete": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "versao",
                    "estado",
                    "url"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "ativo",
                        "revogado"
                      ]
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Webhooks"
        ],
        "summary": "Revogar webhook",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        },
        "description": "Exige webhook:gerenciar, If-Match e Idempotency-Key. Permitido sem assinatura ativa. Corpo ausente ou objeto vazio até 4 KiB. Entrega já em trânsito pode chegar; nenhuma nova entrega da versão revogada é autorizada.",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "deleteV1Webhook"
      }
    },
    "/v1/catalogos/{id}/produtos": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              },
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Caminho da consulta do recurso criado ou da operação aceita. Aceite não comprova conclusão."
              }
            },
            "description": "Response for status 201",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "id_externo",
                    "origem",
                    "sku",
                    "descricao",
                    "ncm",
                    "atributos",
                    "versao",
                    "ativo",
                    "catalogos"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "origem": {
                      "type": "string"
                    },
                    "sku": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "descricao": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ncm": {
                      "type": "string"
                    },
                    "atributos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "codigo",
                          "valores"
                        ],
                        "properties": {
                          "codigo": {
                            "type": "string"
                          },
                          "valores": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "ativo": {
                      "type": "boolean"
                    },
                    "catalogos": {
                      "type": "array",
                      "items": {
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "example": "0198d000-0000-7000-8000-000000000001",
                        "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Produtos"
        ],
        "summary": "Cadastrar produto neste catálogo",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "origem": "erp",
                "id_externo": "00001",
                "ncm": "01012100",
                "atributos": []
              },
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "ncm",
                  "atributos"
                ],
                "properties": {
                  "id_externo": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "sku": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "descricao": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "ncm": {
                    "type": "string",
                    "pattern": "^[0-9]{8}$"
                  },
                  "atributos": {
                    "type": "array",
                    "maxItems": 128,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "codigo",
                        "valores"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "valores": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 50,
                          "items": {
                            "type": "string",
                            "maxLength": 2000
                          }
                        }
                      }
                    }
                  },
                  "origem": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,128}$",
                    "default": "api"
                  }
                }
              }
            }
          }
        },
        "description": "Criação incremental, sem assinatura. Repetição devolve o resultado original com status 201.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          }
        ],
        "operationId": "postV1CatalogosByIdProdutos"
      },
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Catálogos"
        ],
        "summary": "Consultar produtos de um catálogo ativo",
        "description": "Catálogo inexistente, alheio ou excluído retorna 404. Aplica os mesmos filtros e orçamento da consulta empresarial de produtos.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "limite",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^(?:[1-9]|[1-9][0-9]|1[0-9]{2}|200)$",
              "description": "Padrão 50; máximo 200 e orçamento de bytes por página.",
              "type": "string"
            }
          },
          {
            "name": "apos_id",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "origem",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z0-9_-]{1,128}$",
              "type": "string"
            }
          },
          {
            "name": "id_externo",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 512,
              "description": "Igualdade exata; exige origem.",
              "type": "string"
            }
          },
          {
            "name": "sku",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 512,
              "type": "string"
            }
          },
          {
            "name": "ncm",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[0-9]{8}$",
              "type": "string"
            }
          },
          {
            "name": "estado",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ativo",
                "inativo"
              ]
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "itens",
                    "proximo_id"
                  ],
                  "properties": {
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "id_externo",
                          "origem",
                          "sku",
                          "descricao",
                          "ncm",
                          "atributos",
                          "versao",
                          "ativo",
                          "catalogos"
                        ],
                        "properties": {
                          "id": {
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "example": "0198d000-0000-7000-8000-000000000001",
                            "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                            "type": "string"
                          },
                          "id_externo": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "origem": {
                            "type": "string"
                          },
                          "sku": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "descricao": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ncm": {
                            "type": "string"
                          },
                          "atributos": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "codigo",
                                "valores"
                              ],
                              "properties": {
                                "codigo": {
                                  "type": "string"
                                },
                                "valores": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "versao": {
                            "anyOf": [
                              {
                                "format": "integer",
                                "default": 0,
                                "type": "string"
                              },
                              {
                                "type": "integer"
                              }
                            ]
                          },
                          "ativo": {
                            "type": "boolean"
                          },
                          "catalogos": {
                            "type": "array",
                            "items": {
                              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                              "example": "0198d000-0000-7000-8000-000000000001",
                              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "proximo_id": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                          "example": "0198d000-0000-7000-8000-000000000001",
                          "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1CatalogosByIdProdutos"
      }
    },
    "/v1/produtos/{id}": {
      "patch": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "id_externo",
                    "origem",
                    "sku",
                    "descricao",
                    "ncm",
                    "atributos",
                    "versao",
                    "ativo",
                    "catalogos"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "origem": {
                      "type": "string"
                    },
                    "sku": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "descricao": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ncm": {
                      "type": "string"
                    },
                    "atributos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "codigo",
                          "valores"
                        ],
                        "properties": {
                          "codigo": {
                            "type": "string"
                          },
                          "valores": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "ativo": {
                      "type": "boolean"
                    },
                    "catalogos": {
                      "type": "array",
                      "items": {
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "example": "0198d000-0000-7000-8000-000000000001",
                        "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Produtos"
        ],
        "summary": "Editar parcialmente um produto compartilhado",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "descricao": "Descrição atualizada pelo integrador"
              },
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "id_externo": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "sku": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "descricao": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "ncm": {
                    "type": "string",
                    "pattern": "^[0-9]{8}$"
                  },
                  "atributos": {
                    "type": "array",
                    "maxItems": 128,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "codigo",
                        "valores"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "valores": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 50,
                          "items": {
                            "type": "string",
                            "maxLength": 2000
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Omissões preservam campos; null limpa opcionais; atributos substitui a lista completa. Afeta todos os catálogos vinculados.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "patchV1ProdutosById"
      },
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "id_externo",
                    "origem",
                    "sku",
                    "descricao",
                    "ncm",
                    "atributos",
                    "versao",
                    "ativo",
                    "catalogos"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "origem": {
                      "type": "string"
                    },
                    "sku": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "descricao": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ncm": {
                      "type": "string"
                    },
                    "atributos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "codigo",
                          "valores"
                        ],
                        "properties": {
                          "codigo": {
                            "type": "string"
                          },
                          "valores": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "ativo": {
                      "type": "boolean"
                    },
                    "catalogos": {
                      "type": "array",
                      "items": {
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "example": "0198d000-0000-7000-8000-000000000001",
                        "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Produtos"
        ],
        "summary": "Consultar um produto por seu identificador Cotejar",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getV1ProdutosById"
      }
    },
    "/v1/catalogos/{id}/produtos/{produto_id}": {
      "put": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "id_externo",
                    "origem",
                    "sku",
                    "descricao",
                    "ncm",
                    "atributos",
                    "versao",
                    "ativo",
                    "catalogos"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "origem": {
                      "type": "string"
                    },
                    "sku": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "descricao": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ncm": {
                      "type": "string"
                    },
                    "atributos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "codigo",
                          "valores"
                        ],
                        "properties": {
                          "codigo": {
                            "type": "string"
                          },
                          "valores": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "ativo": {
                      "type": "boolean"
                    },
                    "catalogos": {
                      "type": "array",
                      "items": {
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "example": "0198d000-0000-7000-8000-000000000001",
                        "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Produtos"
        ],
        "summary": "Vincular produto existente a este catálogo",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        },
        "description": "Exige ETag do produto e chave de repetição. Não altera seus campos nem o seleciona para vigilância. Vínculo já existente é sucesso sem nova alteração.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "produto_id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "putV1CatalogosByIdProdutosByProduto_id"
      },
      "delete": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "id_externo",
                    "origem",
                    "sku",
                    "descricao",
                    "ncm",
                    "atributos",
                    "versao",
                    "ativo",
                    "catalogos"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "origem": {
                      "type": "string"
                    },
                    "sku": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "descricao": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ncm": {
                      "type": "string"
                    },
                    "atributos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "codigo",
                          "valores"
                        ],
                        "properties": {
                          "codigo": {
                            "type": "string"
                          },
                          "valores": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "ativo": {
                      "type": "boolean"
                    },
                    "catalogos": {
                      "type": "array",
                      "items": {
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "example": "0198d000-0000-7000-8000-000000000001",
                        "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Produtos"
        ],
        "summary": "Retirar produto deste catálogo",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        },
        "description": "Remove somente o vínculo indicado. O último vínculo removido desativa o produto e retira sua seleção, preservando identidade e histórico.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "produto_id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "deleteV1CatalogosByIdProdutosByProduto_id"
      }
    },
    "/v1/produtos": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Produtos"
        ],
        "summary": "Consultar produtos da empresa",
        "description": "Exige catalogo:ler. Ordenação por UUID; use proximo_id como apos_id com os mesmos filtros. Inclui ativos e inativos por padrão. Não representa uma análise regulatória.",
        "parameters": [
          {
            "name": "limite",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^(?:[1-9]|[1-9][0-9]|1[0-9]{2}|200)$",
              "description": "Padrão 50; máximo 200 e orçamento de bytes por página.",
              "type": "string"
            }
          },
          {
            "name": "apos_id",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "origem",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z0-9_-]{1,128}$",
              "type": "string"
            }
          },
          {
            "name": "id_externo",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 512,
              "description": "Igualdade exata; exige origem.",
              "type": "string"
            }
          },
          {
            "name": "sku",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 512,
              "type": "string"
            }
          },
          {
            "name": "ncm",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[0-9]{8}$",
              "type": "string"
            }
          },
          {
            "name": "estado",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ativo",
                "inativo"
              ]
            }
          },
          {
            "name": "catalogo_id",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "itens",
                    "proximo_id"
                  ],
                  "properties": {
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "id_externo",
                          "origem",
                          "sku",
                          "descricao",
                          "ncm",
                          "atributos",
                          "versao",
                          "ativo",
                          "catalogos"
                        ],
                        "properties": {
                          "id": {
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "example": "0198d000-0000-7000-8000-000000000001",
                            "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                            "type": "string"
                          },
                          "id_externo": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "origem": {
                            "type": "string"
                          },
                          "sku": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "descricao": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ncm": {
                            "type": "string"
                          },
                          "atributos": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "codigo",
                                "valores"
                              ],
                              "properties": {
                                "codigo": {
                                  "type": "string"
                                },
                                "valores": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "versao": {
                            "anyOf": [
                              {
                                "format": "integer",
                                "default": 0,
                                "type": "string"
                              },
                              {
                                "type": "integer"
                              }
                            ]
                          },
                          "ativo": {
                            "type": "boolean"
                          },
                          "catalogos": {
                            "type": "array",
                            "items": {
                              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                              "example": "0198d000-0000-7000-8000-000000000001",
                              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "proximo_id": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                          "example": "0198d000-0000-7000-8000-000000000001",
                          "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1Produtos"
      }
    },
    "/v1/conta": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Conta e empresa"
        ],
        "summary": "Consultar o contexto da integração",
        "description": "Exige conta:ler. Mostra somente a empresa e os metadados da chave usada, sem informações da conta pessoal.",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "credencial_id",
                    "cnpj_raiz",
                    "escopos",
                    "expira_em"
                  ],
                  "properties": {
                    "credencial_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "cnpj_raiz": {
                      "type": "string"
                    },
                    "escopos": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "expira_em": {
                      "format": "date-time",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1Conta"
      }
    },
    "/v1/empresa/capacidades": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Conta e empresa"
        ],
        "summary": "Consultar capacidade compartilhada e disponibilidade de análise",
        "description": "Exige conta:ler. Contagem distinta por empresa, sem multiplicar filiais. Não seleciona produtos, consome análise ou comprova varredura; disponibilidade segue a política vigente.",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "plano",
                    "vigilancia",
                    "analise"
                  ],
                  "properties": {
                    "plano": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "vigilancia": {
                      "type": "object",
                      "required": [
                        "cadastrados",
                        "selecionados",
                        "elegiveis",
                        "vagas",
                        "cobertura",
                        "exige_selecao",
                        "modo",
                        "versao",
                        "capacidade",
                        "direito_ativo"
                      ],
                      "properties": {
                        "cadastrados": {
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        "selecionados": {
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        "elegiveis": {
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        "vagas": {
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        "cobertura": {
                          "type": "string",
                          "enum": [
                            "indisponivel",
                            "sem_selecao",
                            "parcial",
                            "integral",
                            "capacidade_excedida"
                          ]
                        },
                        "exige_selecao": {
                          "type": "boolean"
                        },
                        "modo": {
                          "type": "string",
                          "enum": [
                            "selecao",
                            "todos"
                          ]
                        },
                        "versao": {
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        "capacidade": {
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        "direito_ativo": {
                          "type": "boolean"
                        }
                      }
                    },
                    "analise": {
                      "type": "object",
                      "required": [
                        "situacao",
                        "disponivel_em"
                      ],
                      "properties": {
                        "situacao": {
                          "type": "string",
                          "enum": [
                            "liberada",
                            "limite"
                          ]
                        },
                        "disponivel_em": {
                          "nullable": true,
                          "anyOf": [
                            {
                              "format": "date-time",
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1EmpresaCapacidades"
      }
    },
    "/v1/analises": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Caminho da consulta do recurso criado ou da operação aceita. Aceite não comprova conclusão."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "estado"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "pendente",
                        "executando",
                        "concluida",
                        "falhou"
                      ]
                    }
                  }
                }
              }
            }
          },
          "202": {
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Caminho da consulta do recurso criado ou da operação aceita. Aceite não comprova conclusão."
              }
            },
            "description": "Response for status 202",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "estado"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "pendente",
                        "executando",
                        "concluida",
                        "falhou"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Análises"
        ],
        "summary": "Solicitar análise completa da empresa",
        "description": "Exige analise:executar e Idempotency-Key. Envie {}. O aceite durável não consome franquia. Produtos selecionados para vigilância não restringem o diagnóstico.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        },
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          }
        ],
        "operationId": "postV1Analises"
      },
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Análises"
        ],
        "summary": "Listar execuções de análise da empresa",
        "description": "Exige catalogo:ler. Mais recentes primeiro, limite padrão 50 e máximo 100, com orçamento de bytes. Siga proximo_cursor até null.",
        "parameters": [
          {
            "name": "limite",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$",
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 2048,
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "proximo_cursor",
                    "itens"
                  ],
                  "properties": {
                    "proximo_cursor": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "estado",
                          "fase",
                          "criada_em",
                          "terminada_em",
                          "codigo_falha",
                          "resultado_disponivel",
                          "regulamento_degradado"
                        ],
                        "properties": {
                          "id": {
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "example": "0198d000-0000-7000-8000-000000000001",
                            "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                            "type": "string"
                          },
                          "estado": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "const": "pendente",
                                    "type": "string"
                                  },
                                  {
                                    "const": "executando",
                                    "type": "string"
                                  },
                                  {
                                    "const": "concluida",
                                    "type": "string"
                                  },
                                  {
                                    "const": "falhou",
                                    "type": "string"
                                  }
                                ]
                              },
                              {
                                "const": "concluido",
                                "type": "string"
                              }
                            ]
                          },
                          "fase": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "const": "avaliacao",
                                    "type": "string"
                                  },
                                  {
                                    "const": "publicacao",
                                    "type": "string"
                                  },
                                  {
                                    "const": "relatorio",
                                    "type": "string"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "criada_em": {
                            "type": "string"
                          },
                          "terminada_em": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "codigo_falha": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "resultado_disponivel": {
                            "type": "boolean"
                          },
                          "regulamento_degradado": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "boolean"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1Analises"
      }
    },
    "/v1/analises/{id}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Análises"
        ],
        "summary": "Consultar execução e resumo da análise",
        "description": "Exige catalogo:ler. Retorna falha, pendência e degradação explicitamente.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "estado",
                    "criada_em",
                    "terminada_em",
                    "codigo_falha",
                    "resultado"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "pendente",
                        "executando",
                        "concluida",
                        "falhou"
                      ]
                    },
                    "criada_em": {
                      "type": "string"
                    },
                    "terminada_em": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "codigo_falha": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "resultado": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "snapshot_id",
                            "versao_portal",
                            "versao_avaliador",
                            "executada_em",
                            "regras_coletadas_em",
                            "ultima_coleta_util_em",
                            "regulamento_degradado",
                            "assinante",
                            "franquia_consumida",
                            "produtos_avaliados",
                            "divergencias",
                            "catalogos",
                            "paginas_resultado"
                          ],
                          "properties": {
                            "snapshot_id": {
                              "type": "string"
                            },
                            "versao_portal": {
                              "type": "string"
                            },
                            "versao_avaliador": {
                              "anyOf": [
                                {
                                  "const": "1",
                                  "type": "string"
                                },
                                {
                                  "const": "2",
                                  "type": "string"
                                }
                              ]
                            },
                            "executada_em": {
                              "type": "string"
                            },
                            "regras_coletadas_em": {
                              "type": "string"
                            },
                            "ultima_coleta_util_em": {
                              "nullable": true,
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "regulamento_degradado": {
                              "type": "boolean"
                            },
                            "assinante": {
                              "type": "boolean"
                            },
                            "franquia_consumida": {
                              "type": "boolean"
                            },
                            "produtos_avaliados": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "divergencias": {
                              "type": "object",
                              "required": [
                                "orfao",
                                "bloqueante",
                                "deriva",
                                "anvisa"
                              ],
                              "properties": {
                                "orfao": {
                                  "anyOf": [
                                    {
                                      "format": "integer",
                                      "default": 0,
                                      "type": "string"
                                    },
                                    {
                                      "type": "integer"
                                    }
                                  ]
                                },
                                "bloqueante": {
                                  "anyOf": [
                                    {
                                      "format": "integer",
                                      "default": 0,
                                      "type": "string"
                                    },
                                    {
                                      "type": "integer"
                                    }
                                  ]
                                },
                                "deriva": {
                                  "anyOf": [
                                    {
                                      "format": "integer",
                                      "default": 0,
                                      "type": "string"
                                    },
                                    {
                                      "type": "integer"
                                    }
                                  ]
                                },
                                "anvisa": {
                                  "anyOf": [
                                    {
                                      "format": "integer",
                                      "default": 0,
                                      "type": "string"
                                    },
                                    {
                                      "type": "integer"
                                    }
                                  ]
                                }
                              }
                            },
                            "catalogos": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "id",
                                  "versao"
                                ],
                                "properties": {
                                  "id": {
                                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                                    "example": "0198d000-0000-7000-8000-000000000001",
                                    "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                                    "type": "string"
                                  },
                                  "versao": {
                                    "anyOf": [
                                      {
                                        "format": "integer",
                                        "default": 0,
                                        "type": "string"
                                      },
                                      {
                                        "type": "integer"
                                      }
                                    ]
                                  }
                                }
                              }
                            },
                            "paginas_resultado": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1AnalisesById"
      }
    },
    "/v1/analises/{id}/resultados.csv": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Análises"
        ],
        "summary": "Exportar o resultado completo da análise em CSV",
        "description": "Exige catalogo:ler. UTF-8 com BOM e ponto e vírgula. Registros resumo, achado e conclusao, sem consumir análise. Só aceite o arquivo após verificar X-Cotejar-Tamanho-Bytes, Content-Digest e conclusao; HTTP 200 sozinho não comprova download completo.",
        "responses": {
          "200": {
            "description": "CSV imutável do resultado publicado, com resumo e todos os achados.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "X-Cotejar-Tamanho-Bytes": {
                "schema": {
                  "type": "integer"
                },
                "description": "Quantidade exata de bytes do arquivo, inclusive BOM e conclusão. Verificação obrigatória pelo consumidor."
              },
              "Content-Digest": {
                "schema": {
                  "type": "string"
                },
                "description": "SHA-256 dos bytes completos do CSV."
              }
            }
          },
          "401": {
            "description": "Falha HTTP 401; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Falha HTTP 403; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Falha HTTP 404; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Falha HTTP 409; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Falha HTTP 422; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Falha HTTP 429; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Falha HTTP 503; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getV1AnalisesByIdResultados.csv"
      }
    },
    "/v1/analises/{id}/resultados": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Análises"
        ],
        "summary": "Consultar todos os achados da análise",
        "description": "Exige catalogo:ler. Páginas imutáveis de até 200 achados e limitadas por bytes; proxima_pagina nula encerra. Não consome análise.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "pagina",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[1-9][0-9]{0,4}$",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "itens",
                    "proxima_pagina"
                  ],
                  "properties": {
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "produto_id",
                          "codigo_produto",
                          "ncm",
                          "tipo",
                          "codigo_atributo",
                          "detalhe"
                        ],
                        "properties": {
                          "produto_id": {
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "example": "0198d000-0000-7000-8000-000000000001",
                            "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                            "type": "string"
                          },
                          "codigo_produto": {
                            "type": "string"
                          },
                          "ncm": {
                            "type": "string"
                          },
                          "tipo": {
                            "type": "string",
                            "enum": [
                              "orfao",
                              "bloqueante",
                              "deriva",
                              "anvisa"
                            ]
                          },
                          "codigo_atributo": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "detalhe": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "proxima_pagina": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1AnalisesByIdResultados"
      }
    },
    "/v1/vigilancias": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Vigilância"
        ],
        "summary": "Listar execuções de vigilância da empresa",
        "description": "Exige catalogo:ler. Histórico preservado após suspensão. Mais recentes primeiro; siga proximo_cursor até null, com até 100 itens e orçamento de bytes.",
        "parameters": [
          {
            "name": "limite",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$",
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 2048,
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "proximo_cursor",
                    "itens"
                  ],
                  "properties": {
                    "proximo_cursor": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "estado",
                          "fase",
                          "criada_em",
                          "terminada_em",
                          "codigo_falha",
                          "resultado_disponivel",
                          "regulamento_degradado"
                        ],
                        "properties": {
                          "id": {
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "example": "0198d000-0000-7000-8000-000000000001",
                            "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                            "type": "string"
                          },
                          "estado": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "const": "pendente",
                                    "type": "string"
                                  },
                                  {
                                    "const": "executando",
                                    "type": "string"
                                  },
                                  {
                                    "const": "concluida",
                                    "type": "string"
                                  },
                                  {
                                    "const": "falhou",
                                    "type": "string"
                                  }
                                ]
                              },
                              {
                                "const": "concluido",
                                "type": "string"
                              }
                            ]
                          },
                          "fase": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "const": "avaliacao",
                                    "type": "string"
                                  },
                                  {
                                    "const": "publicacao",
                                    "type": "string"
                                  },
                                  {
                                    "const": "relatorio",
                                    "type": "string"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "criada_em": {
                            "type": "string"
                          },
                          "terminada_em": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "codigo_falha": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "resultado_disponivel": {
                            "type": "boolean"
                          },
                          "regulamento_degradado": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "boolean"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1Vigilancias"
      }
    },
    "/v1/vigilancias/{id}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Vigilância"
        ],
        "summary": "Consultar execução da vigilância",
        "description": "Exige catalogo:ler. Histórico disponível após suspensão. Resultado publicado pode coexistir com relatório pendente ou falho; consulte estado e fase.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "estado",
                    "fase",
                    "criada_em",
                    "terminada_em",
                    "codigo_falha",
                    "resultado"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "pendente",
                        "executando",
                        "concluido",
                        "falhou"
                      ]
                    },
                    "fase": {
                      "type": "string",
                      "enum": [
                        "avaliacao",
                        "publicacao",
                        "relatorio"
                      ]
                    },
                    "criada_em": {
                      "type": "string"
                    },
                    "terminada_em": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "codigo_falha": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "resultado": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "executada_em",
                            "snapshot_id",
                            "modo",
                            "produtos_verificados",
                            "produtos_avaliados",
                            "produtos_cadastrados",
                            "total_achados",
                            "regulamento_degradado",
                            "ultima_coleta_util_em",
                            "novas",
                            "reabertas",
                            "resolvidas"
                          ],
                          "properties": {
                            "executada_em": {
                              "type": "string"
                            },
                            "snapshot_id": {
                              "type": "string"
                            },
                            "modo": {
                              "anyOf": [
                                {
                                  "const": "completa",
                                  "type": "string"
                                },
                                {
                                  "const": "incremental",
                                  "type": "string"
                                }
                              ]
                            },
                            "produtos_verificados": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "produtos_avaliados": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "produtos_cadastrados": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "total_achados": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "regulamento_degradado": {
                              "type": "boolean"
                            },
                            "ultima_coleta_util_em": {
                              "nullable": true,
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "novas": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "reabertas": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "resolvidas": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1VigilanciasById"
      }
    },
    "/v1/vigilancias/{id}/resultados.csv": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Vigilância"
        ],
        "summary": "Exportar o resultado publicado da vigilância em CSV",
        "description": "Exige catalogo:ler. Preserva data e snapshot da avaliação efetiva dos achados reaproveitados. UTF-8 com BOM e ponto e vírgula. Verifique X-Cotejar-Tamanho-Bytes, Content-Digest e conclusao; HTTP 200 sozinho não comprova download completo. Disponível após publicação, mesmo com relatório pendente.",
        "responses": {
          "200": {
            "description": "CSV imutável do resultado publicado, com resumo e todos os achados.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "X-Cotejar-Tamanho-Bytes": {
                "schema": {
                  "type": "integer"
                },
                "description": "Quantidade exata de bytes do arquivo, inclusive BOM e conclusão. Verificação obrigatória pelo consumidor."
              },
              "Content-Digest": {
                "schema": {
                  "type": "string"
                },
                "description": "SHA-256 dos bytes completos do CSV."
              }
            }
          },
          "401": {
            "description": "Falha HTTP 401; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Falha HTTP 403; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Falha HTTP 404; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Falha HTTP 409; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Falha HTTP 422; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Falha HTTP 429; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Falha HTTP 503; nenhum CSV completo disponível.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getV1VigilanciasByIdResultados.csv"
      }
    },
    "/v1/vigilancias/{id}/resultados": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Vigilância"
        ],
        "summary": "Consultar achados imutáveis da vigilância",
        "description": "Exige catalogo:ler. Até 200 achados e orçamento de bytes. Siga proximo_cursor até null, inclusive em página vazia. Achados reaproveitados mantêm a data e snapshot da avaliação efetiva.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 4096,
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total_achados",
                    "proximo_cursor",
                    "itens"
                  ],
                  "properties": {
                    "total_achados": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "proximo_cursor": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "produto_id",
                          "ncm",
                          "tipo",
                          "codigo_atributo",
                          "detalhe",
                          "avaliado_em",
                          "snapshot_id",
                          "reaproveitado"
                        ],
                        "properties": {
                          "produto_id": {
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "example": "0198d000-0000-7000-8000-000000000001",
                            "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                            "type": "string"
                          },
                          "ncm": {
                            "type": "string"
                          },
                          "tipo": {
                            "type": "string",
                            "enum": [
                              "orfao",
                              "bloqueante",
                              "deriva",
                              "anvisa"
                            ]
                          },
                          "codigo_atributo": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "detalhe": {
                            "type": "string"
                          },
                          "avaliado_em": {
                            "type": "string"
                          },
                          "snapshot_id": {
                            "type": "string"
                          },
                          "reaproveitado": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1VigilanciasByIdResultados"
      }
    },
    "/v1/empresa/vigilancia": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "cadastrados",
                    "selecionados",
                    "elegiveis",
                    "vagas",
                    "cobertura",
                    "exige_selecao",
                    "modo",
                    "versao",
                    "capacidade",
                    "direito_ativo"
                  ],
                  "properties": {
                    "cadastrados": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "selecionados": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "elegiveis": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "vagas": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "cobertura": {
                      "type": "string",
                      "enum": [
                        "indisponivel",
                        "sem_selecao",
                        "parcial",
                        "integral",
                        "capacidade_excedida"
                      ]
                    },
                    "exige_selecao": {
                      "type": "boolean"
                    },
                    "modo": {
                      "type": "string",
                      "enum": [
                        "selecao",
                        "todos"
                      ]
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "capacidade": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "direito_ativo": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Vigilância"
        ],
        "summary": "Consultar seleção e capacidade compartilhadas",
        "description": "Exige catalogo:ler. O ETag protege alterações da seleção. Preferência preservada não comprova vigilância executada.",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getV1EmpresaVigilancia"
      },
      "patch": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "cadastrados",
                    "selecionados",
                    "elegiveis",
                    "vagas",
                    "cobertura",
                    "exige_selecao",
                    "modo",
                    "versao",
                    "capacidade",
                    "direito_ativo"
                  ],
                  "properties": {
                    "cadastrados": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "selecionados": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "elegiveis": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "vagas": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "cobertura": {
                      "type": "string",
                      "enum": [
                        "indisponivel",
                        "sem_selecao",
                        "parcial",
                        "integral",
                        "capacidade_excedida"
                      ]
                    },
                    "exige_selecao": {
                      "type": "boolean"
                    },
                    "modo": {
                      "type": "string",
                      "enum": [
                        "selecao",
                        "todos"
                      ]
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "capacidade": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "direito_ativo": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Vigilância"
        ],
        "summary": "Trocar produtos selecionados ou vigiar todos",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "modo"
                ],
                "properties": {
                  "modo": {
                    "type": "string",
                    "enum": [
                      "selecao",
                      "todos"
                    ]
                  },
                  "adicionar": {
                    "type": "array",
                    "maxItems": 200,
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    }
                  },
                  "remover": {
                    "type": "array",
                    "maxItems": 200,
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Exige vigilancia:gerenciar, Idempotency-Key e If-Match. Até 200 inclusões/retiradas por pedido. Modo todos exige capacidade para todo o catálogo. Não executa análise nem altera cobrança; excesso recusa a troca inteira.",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "patchV1EmpresaVigilancia"
      }
    },
    "/v1/empresa/vigilancia/produtos": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Vigilância"
        ],
        "summary": "Consultar os produtos selecionados",
        "description": "Exige catalogo:ler. Até 200 por página. Ao continuar com apos_id, envie a versao retornada; mudança da seleção exige reiniciar a paginação.",
        "parameters": [
          {
            "name": "limite",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^(?:[1-9]|[1-9][0-9]|1[0-9]{2}|200)$",
              "description": "Padrão 50; máximo 200 e orçamento de bytes por página.",
              "type": "string"
            }
          },
          {
            "name": "apos_id",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "versao",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[1-9][0-9]*$",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "itens",
                    "versao",
                    "proximo_id"
                  ],
                  "properties": {
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "produto_id",
                          "selecionado_em"
                        ],
                        "properties": {
                          "produto_id": {
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "example": "0198d000-0000-7000-8000-000000000001",
                            "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                            "type": "string"
                          },
                          "selecionado_em": {
                            "format": "date-time",
                            "type": "string"
                          }
                        }
                      }
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "proximo_id": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                          "example": "0198d000-0000-7000-8000-000000000001",
                          "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1EmpresaVigilanciaProdutos"
      }
    },
    "/v1/empresa": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Conta e empresa"
        ],
        "summary": "Consultar a identidade da empresa autorizada",
        "description": "Exige conta:ler. Uma empresa arquivada não pode ser consultada com sua chave revogada.",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "cnpj",
                    "cnpj_raiz",
                    "razao_social",
                    "estado"
                  ],
                  "properties": {
                    "cnpj": {
                      "type": "string"
                    },
                    "cnpj_raiz": {
                      "type": "string"
                    },
                    "razao_social": {
                      "type": "string"
                    },
                    "estado": {
                      "const": "ativa",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1Empresa"
      }
    },
    "/v1/catalogos": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Catálogos"
        ],
        "summary": "Consultar catálogos da empresa",
        "description": "Inclui ativos e excluídos por padrão. Contagem de vínculos cadastrados; não representa cobertura nem resultado regulatório.",
        "parameters": [
          {
            "name": "limite",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^(?:[1-9]|[1-9][0-9]|1[0-9]{2}|200)$",
              "description": "Padrão 50; máximo 200 e orçamento de bytes por página.",
              "type": "string"
            }
          },
          {
            "name": "apos_id",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "estabelecimento_id",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "id_externo",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 256,
              "type": "string"
            }
          },
          {
            "name": "estado",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ativo",
                "excluido"
              ]
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "itens",
                    "proximo_id"
                  ],
                  "properties": {
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "id_externo",
                          "estabelecimento_id",
                          "cnpj_estabelecimento",
                          "nome",
                          "estado",
                          "versao",
                          "produtos",
                          "criado_em",
                          "atualizado_em",
                          "excluido_em"
                        ],
                        "properties": {
                          "id": {
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "example": "0198d000-0000-7000-8000-000000000001",
                            "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                            "type": "string"
                          },
                          "id_externo": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "estabelecimento_id": {
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "example": "0198d000-0000-7000-8000-000000000001",
                            "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                            "type": "string"
                          },
                          "cnpj_estabelecimento": {
                            "type": "string"
                          },
                          "nome": {
                            "type": "string"
                          },
                          "estado": {
                            "type": "string",
                            "enum": [
                              "ativo",
                              "excluido"
                            ]
                          },
                          "versao": {
                            "anyOf": [
                              {
                                "format": "integer",
                                "default": 0,
                                "type": "string"
                              },
                              {
                                "type": "integer"
                              }
                            ]
                          },
                          "produtos": {
                            "anyOf": [
                              {
                                "format": "integer",
                                "default": 0,
                                "type": "string"
                              },
                              {
                                "type": "integer"
                              }
                            ]
                          },
                          "criado_em": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "atualizado_em": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "excluido_em": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "format": "date-time",
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      }
                    },
                    "proximo_id": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                          "example": "0198d000-0000-7000-8000-000000000001",
                          "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1Catalogos"
      },
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              },
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Caminho da consulta do recurso criado ou da operação aceita. Aceite não comprova conclusão."
              }
            },
            "description": "Response for status 201",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "id_externo",
                    "estabelecimento_id",
                    "cnpj_estabelecimento",
                    "nome",
                    "estado",
                    "versao",
                    "produtos",
                    "criado_em",
                    "atualizado_em",
                    "excluido_em"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "estabelecimento_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "cnpj_estabelecimento": {
                      "type": "string"
                    },
                    "nome": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "ativo",
                        "excluido"
                      ]
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "produtos": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "criado_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "atualizado_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "excluido_em": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "format": "date-time",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Catálogos"
        ],
        "summary": "Criar catálogo para estabelecimento existente",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "estabelecimento_id": "0198d000-0000-7000-8000-000000000001",
                "nome": "Catálogo da filial",
                "id_externo": "filial-01"
              },
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "estabelecimento_id",
                  "nome"
                ],
                "properties": {
                  "nome": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "id_externo": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "estabelecimento_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "description": "Exige catalogo:gerenciar. Um catálogo ativo por estabelecimento. Não cria filial nem seleciona produtos.",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          }
        ],
        "operationId": "postV1Catalogos"
      }
    },
    "/v1/catalogos/{id}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "id_externo",
                    "estabelecimento_id",
                    "cnpj_estabelecimento",
                    "nome",
                    "estado",
                    "versao",
                    "produtos",
                    "criado_em",
                    "atualizado_em",
                    "excluido_em"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "estabelecimento_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "cnpj_estabelecimento": {
                      "type": "string"
                    },
                    "nome": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "ativo",
                        "excluido"
                      ]
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "produtos": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "criado_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "atualizado_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "excluido_em": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "format": "date-time",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Catálogos"
        ],
        "summary": "Consultar identidade, estado e versão de um catálogo",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getV1CatalogosById"
      },
      "patch": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "id_externo",
                    "estabelecimento_id",
                    "cnpj_estabelecimento",
                    "nome",
                    "estado",
                    "versao",
                    "produtos",
                    "criado_em",
                    "atualizado_em",
                    "excluido_em"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "estabelecimento_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "cnpj_estabelecimento": {
                      "type": "string"
                    },
                    "nome": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "ativo",
                        "excluido"
                      ]
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "produtos": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "criado_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "atualizado_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "excluido_em": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "format": "date-time",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Catálogos"
        ],
        "summary": "Editar nome ou referência externa do catálogo",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "nome": "Nome atualizado pelo integrador"
              },
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "nome": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "id_externo": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 256
                  }
                }
              }
            }
          }
        },
        "description": "Exige catalogo:gerenciar. Campos omitidos são preservados; null limpa a referência. Não transfere empresa ou estabelecimento.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "patchV1CatalogosById"
      },
      "delete": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "id_externo",
                    "estabelecimento_id",
                    "cnpj_estabelecimento",
                    "nome",
                    "estado",
                    "versao",
                    "produtos",
                    "criado_em",
                    "atualizado_em",
                    "excluido_em"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "estabelecimento_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "cnpj_estabelecimento": {
                      "type": "string"
                    },
                    "nome": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "ativo",
                        "excluido"
                      ]
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "produtos": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "criado_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "atualizado_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "excluido_em": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "format": "date-time",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Catálogos"
        ],
        "summary": "Excluir catálogo após conferir impacto",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        },
        "description": "Exige catalogo:gerenciar e If-Match da prévia de impacto. Preserva produtos compartilhados e histórico. Mudança desde a prévia retorna 412 sem exclusão parcial.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "deleteV1CatalogosById"
      }
    },
    "/v1/catalogos/{id}/impacto-exclusao": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "catalogo_id",
                    "versao",
                    "produtos",
                    "exclusivos",
                    "compartilhados",
                    "produtos_desativados",
                    "selecoes_removidas",
                    "selecoes_adicionadas",
                    "vigilancia"
                  ],
                  "properties": {
                    "catalogo_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "produtos": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "exclusivos": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "compartilhados": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "produtos_desativados": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "selecoes_removidas": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "selecoes_adicionadas": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "vigilancia": {
                      "type": "object",
                      "required": [
                        "modo",
                        "versao",
                        "capacidade",
                        "direito_ativo",
                        "antes",
                        "depois"
                      ],
                      "properties": {
                        "modo": {
                          "type": "string",
                          "enum": [
                            "selecao",
                            "todos"
                          ]
                        },
                        "versao": {
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        "capacidade": {
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        "direito_ativo": {
                          "type": "boolean"
                        },
                        "antes": {
                          "type": "object",
                          "required": [
                            "cadastrados",
                            "selecionados",
                            "elegiveis",
                            "vagas",
                            "cobertura",
                            "exige_selecao"
                          ],
                          "properties": {
                            "cadastrados": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "selecionados": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "elegiveis": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "vagas": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "cobertura": {
                              "type": "string",
                              "enum": [
                                "indisponivel",
                                "sem_selecao",
                                "parcial",
                                "integral",
                                "capacidade_excedida"
                              ]
                            },
                            "exige_selecao": {
                              "type": "boolean"
                            }
                          }
                        },
                        "depois": {
                          "type": "object",
                          "required": [
                            "cadastrados",
                            "selecionados",
                            "elegiveis",
                            "vagas",
                            "cobertura",
                            "exige_selecao"
                          ],
                          "properties": {
                            "cadastrados": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "selecionados": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "elegiveis": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "vagas": {
                              "anyOf": [
                                {
                                  "format": "integer",
                                  "default": 0,
                                  "type": "string"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "cobertura": {
                              "type": "string",
                              "enum": [
                                "indisponivel",
                                "sem_selecao",
                                "parcial",
                                "integral",
                                "capacidade_excedida"
                              ]
                            },
                            "exige_selecao": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Catálogos"
        ],
        "summary": "Consultar o impacto da exclusão do catálogo",
        "description": "Exige catalogo:gerenciar. Projeta cadastro e seleção, sem executar análise ou varredura. Use o ETag desta prévia no DELETE.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getV1CatalogosByIdImpacto-exclusao"
      }
    },
    "/v1/estabelecimentos": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Estabelecimentos"
        ],
        "summary": "Consultar matriz e filiais da empresa",
        "description": "Inclui ativos e arquivados por padrão. catalogo_id identifica somente o catálogo ativo; é nulo quando não houver.",
        "parameters": [
          {
            "name": "limite",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^(?:[1-9]|[1-9][0-9]|1[0-9]{2}|200)$",
              "description": "Padrão 50; máximo 200 e orçamento de bytes por página.",
              "type": "string"
            }
          },
          {
            "name": "apos_id",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "id_externo",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 256,
              "description": "Referência externa exata, incluindo espaços e maiúsculas.",
              "type": "string"
            }
          },
          {
            "name": "estado",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ativo",
                "arquivado"
              ]
            }
          },
          {
            "name": "cnpj",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[A-Z0-9]{12}[0-9]{2}$",
              "description": "CNPJ completo, sem pontuação; dígitos verificadores conferidos.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "itens",
                    "proximo_id"
                  ],
                  "properties": {
                    "itens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "cnpj",
                          "nome",
                          "estado",
                          "versao",
                          "catalogo_id",
                          "id_externo"
                        ],
                        "properties": {
                          "id": {
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "example": "0198d000-0000-7000-8000-000000000001",
                            "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                            "type": "string"
                          },
                          "cnpj": {
                            "type": "string"
                          },
                          "nome": {
                            "type": "string"
                          },
                          "estado": {
                            "type": "string",
                            "enum": [
                              "ativo",
                              "arquivado"
                            ]
                          },
                          "versao": {
                            "anyOf": [
                              {
                                "format": "integer",
                                "default": 0,
                                "type": "string"
                              },
                              {
                                "type": "integer"
                              }
                            ]
                          },
                          "catalogo_id": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                                "example": "0198d000-0000-7000-8000-000000000001",
                                "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "id_externo": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      }
                    },
                    "proximo_id": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                          "example": "0198d000-0000-7000-8000-000000000001",
                          "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1Estabelecimentos"
      },
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              },
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Caminho da consulta do recurso criado ou da operação aceita. Aceite não comprova conclusão."
              }
            },
            "description": "Response for status 201",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "cnpj",
                    "nome",
                    "estado",
                    "versao",
                    "catalogo_id",
                    "id_externo"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "cnpj": {
                      "type": "string"
                    },
                    "nome": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "ativo",
                        "arquivado"
                      ]
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "catalogo_id": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                          "example": "0198d000-0000-7000-8000-000000000001",
                          "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Estabelecimentos"
        ],
        "summary": "Cadastrar matriz ou filial",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "cnpj": "12345678000195",
                "nome": "Matriz",
                "id_externo": "matriz-01"
              },
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cnpj",
                  "nome"
                ],
                "properties": {
                  "nome": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "id_externo": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "cnpj": {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{12}[0-9]{2}$"
                  }
                }
              }
            }
          }
        },
        "description": "Exige estabelecimento:gerenciar. CNPJ da mesma raiz, nome obrigatório e referência externa opcional. Não cria catálogo nem contrata vigilância.",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          }
        ],
        "operationId": "postV1Estabelecimentos"
      }
    },
    "/v1/estabelecimentos/{id}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "cnpj",
                    "nome",
                    "estado",
                    "versao",
                    "catalogo_id",
                    "id_externo"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "cnpj": {
                      "type": "string"
                    },
                    "nome": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "ativo",
                        "arquivado"
                      ]
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "catalogo_id": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                          "example": "0198d000-0000-7000-8000-000000000001",
                          "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Estabelecimentos"
        ],
        "summary": "Consultar identidade e versão de um estabelecimento",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getV1EstabelecimentosById"
      },
      "patch": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "cnpj",
                    "nome",
                    "estado",
                    "versao",
                    "catalogo_id",
                    "id_externo"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "cnpj": {
                      "type": "string"
                    },
                    "nome": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "ativo",
                        "arquivado"
                      ]
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "catalogo_id": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                          "example": "0198d000-0000-7000-8000-000000000001",
                          "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Estabelecimentos"
        ],
        "summary": "Editar nome ou referência do estabelecimento",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "nome": "Nome atualizado pelo integrador"
              },
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "nome": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "id_externo": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 256
                  }
                }
              }
            }
          }
        },
        "description": "Exige estabelecimento:gerenciar. Campos omitidos são preservados; null limpa a referência. Correção de CNPJ exige o fluxo separado de revisão.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "patchV1EstabelecimentosById"
      },
      "delete": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Versão opaca do recurso, incluindo aspas. Preserve o valor completo ao enviar If-Match."
              }
            },
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "cnpj",
                    "nome",
                    "estado",
                    "versao",
                    "catalogo_id",
                    "id_externo"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "cnpj": {
                      "type": "string"
                    },
                    "nome": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "ativo",
                        "arquivado"
                      ]
                    },
                    "versao": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "catalogo_id": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                          "example": "0198d000-0000-7000-8000-000000000001",
                          "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id_externo": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Estabelecimentos"
        ],
        "summary": "Arquivar estabelecimento sem catálogo ativo",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        },
        "description": "Exige estabelecimento:gerenciar. Preserva identidade e histórico. Catálogo ativo impede arquivamento com 409.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "deleteV1EstabelecimentosById"
      }
    },
    "/v1/operacoes/{id}": {
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Estabelecimentos"
        ],
        "summary": "Acompanhar solicitação de correção de CNPJ",
        "description": "Exige estabelecimento:gerenciar. Retorna o estado atual da revisão humana; pendente não significa correção aplicada.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "tipo",
                    "estabelecimento_id",
                    "versao_esperada",
                    "cnpj_anterior",
                    "cnpj_novo",
                    "motivo",
                    "estado",
                    "criada_em",
                    "decidida_em"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "tipo": {
                      "const": "correcao_cnpj",
                      "type": "string"
                    },
                    "estabelecimento_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "versao_esperada": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "cnpj_anterior": {
                      "type": "string"
                    },
                    "cnpj_novo": {
                      "type": "string"
                    },
                    "motivo": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "pendente",
                        "aprovada",
                        "rejeitada"
                      ]
                    },
                    "criada_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "decidida_em": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "format": "date-time",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getV1OperacoesById"
      }
    },
    "/v1/estabelecimentos/{id}/correcoes-cnpj": {
      "post": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Caminho da consulta do recurso criado ou da operação aceita. Aceite não comprova conclusão."
              }
            },
            "description": "Response for status 202",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "tipo",
                    "estabelecimento_id",
                    "versao_esperada",
                    "cnpj_anterior",
                    "cnpj_novo",
                    "motivo",
                    "estado",
                    "criada_em",
                    "decidida_em"
                  ],
                  "properties": {
                    "id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "tipo": {
                      "const": "correcao_cnpj",
                      "type": "string"
                    },
                    "estabelecimento_id": {
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "example": "0198d000-0000-7000-8000-000000000001",
                      "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
                      "type": "string"
                    },
                    "versao_esperada": {
                      "anyOf": [
                        {
                          "format": "integer",
                          "default": 0,
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "cnpj_anterior": {
                      "type": "string"
                    },
                    "cnpj_novo": {
                      "type": "string"
                    },
                    "motivo": {
                      "type": "string"
                    },
                    "estado": {
                      "type": "string",
                      "enum": [
                        "pendente",
                        "aprovada",
                        "rejeitada"
                      ]
                    },
                    "criada_em": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "decidida_em": {
                      "nullable": true,
                      "anyOf": [
                        {
                          "format": "date-time",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Response for status 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Response for status 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Response for status 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Response for status 404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "408": {
            "description": "Response for status 408",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Response for status 409",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "Response for status 412",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response for status 413",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Response for status 415",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Response for status 422",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "428": {
            "description": "Response for status 428",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Response for status 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Response for status 503",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erro"
                  ],
                  "properties": {
                    "erro": {
                      "type": "object",
                      "required": [
                        "codigo",
                        "mensagem",
                        "request_id"
                      ],
                      "properties": {
                        "codigo": {
                          "type": "string"
                        },
                        "mensagem": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string"
                        },
                        "caminho": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Estabelecimentos"
        ],
        "summary": "Solicitar revisão do CNPJ de um estabelecimento",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cnpj_novo",
                  "motivo"
                ],
                "properties": {
                  "cnpj_novo": {
                    "type": "string",
                    "pattern": "^[A-Z0-9]{12}[0-9]{2}$"
                  },
                  "motivo": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "description": "Exige estabelecimento:gerenciar, ETag do estabelecimento e chave de repetição. Aceitação durável, sem aplicar a correção. Repetição devolve a aceitação original; consulte Location para o estado atual.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "example": "0198d000-0000-7000-8000-000000000001",
              "description": "Exemplo sintético; substitua pelo UUID obtido na consulta do seu recurso.",
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "example": "pedido-exemplo-00000001",
              "description": "Gere uma chave por pedido e preserve-a somente nas repetições desse mesmo pedido.",
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": true,
            "schema": {
              "description": "ETag completo da consulta do recurso, incluindo aspas.",
              "type": "string"
            }
          }
        ],
        "operationId": "postV1EstabelecimentosByIdCorrecoes-cnpj"
      }
    }
  }
}
