{
  "openapi": "3.1.0",
  "info": {
    "title": "API Planejalfa",
    "version": "1.1.0",
    "description": "Tudo o que você precisa para conectar sua empresa à **Planejalfa**. Integre contatos, negócios, funis, propostas, contratos, agenda, projetos, catálogo, orçamentos financeiros e faturas.\n\n## Primeiros passos\n\n1. No painel, abra **Administração → Chaves de API** e crie uma chave com as permissões necessárias.\n2. Copie o segredo exibido uma única vez e guarde-o no servidor da sua integração.\n3. Envie `Authorization: Bearer SUA_CHAVE` e consulte **GET /v1/me** para validar a conexão.\n\nNa referência interativa, preencha o campo **Sua chave** apenas com a chave, sem o prefixo `Bearer`. As requisições são reais e usam o ambiente exibido em **Servidor**. O token não é persistido por esta documentação.\n\n\n<details>\n<summary>Autenticação e permissões</summary>\n\nA chave identifica a empresa. Cada requisição verifica os escopos da chave, o acesso do seu criador e os módulos do plano. Chaves revogadas ou expiradas não são aceitas.\n\n| Recurso | Consultar | Criar e editar |\n| --- | --- | --- |\n| Contatos | `contacts:read` | `contacts:write` |\n| Negócios | `deals:read` | `deals:write` |\n| Funis e etapas | `pipelines:read` | Não disponível na v1 |\n| Propostas | `proposals:read` | `proposals:write` |\n| Contratos | `contracts:read` | `contracts:write` |\n| Agenda | `calendar:read` | `calendar:write` |\n| Projetos | `projects:read` | `projects:write` |\n| Catálogo | `catalog:read` | `catalog:write` |\n| Orçamentos financeiros | `budgets:read` | `budgets:write` |\n| Faturas | `invoices:read` | `invoices:write` |\n\nMantenha as chaves no servidor. Não as inclua em páginas públicas ou URLs. A API não habilita CORS para origens externas.\n\n</details>\n\n<details>\n<summary>Criar e atualizar com segurança</summary>\n\n**Criação com POST:** envie o cabeçalho `Idempotency-Key` com um identificador de 8 a 128 caracteres (letras, números, ponto, hífen ou sublinhado). Em caso de timeout, repita a mesma chave e o mesmo corpo. Durante 24 horas, uma criação já concluída retorna o resultado original. Dados diferentes com a mesma chave geram **409**.\n\n**Atualização com PATCH:** contatos e negócios exigem o `updatedAt` retornado na consulta, com conflito **409** se o registro mudou. Os demais recursos seguem as transições e validações descritas em cada operação.\n\nContatos e negócios aceitam corpos de até **16 KB**; os novos recursos aceitam até **64 KB**. Somente os campos documentados são aceitos. Os exemplos são ilustrativos: substitua os IDs e datas pelos valores retornados na sua conta.\n\n</details>\n\n<details>\n<summary>Paginação e formatos</summary>\n\nListas usam `page` (padrão 1) e `perPage` (padrão 20, máximo 50), com resultados em `items` e metadados em `pagination`. Datas e horários usam ISO 8601; valores monetários são strings decimais, como `\"12500.00\"`.\n\n</details>\n\n<details>\n<summary>Erros e limites</summary>\n\n| Status | Significado | Como continuar |\n| --- | --- | --- |\n| 400 | Requisição inválida | Confira os campos e cabeçalhos exigidos. |\n| 401 | Chave ausente, inválida ou expirada | Confira a credencial utilizada. |\n| 403 | Acesso não permitido | Confira escopos, permissões e plano. |\n| 404 | Registro não encontrado | Use um ID pertencente à sua empresa. |\n| 409 | Conflito ou criação em andamento | Confira o código do erro; atualize os dados ou aguarde para repetir. |\n| 422 | Validação não atendida | Corrija o campo indicado na mensagem. |\n| 429 | Limite de requisições atingido | Aguarde o tempo indicado em `Retry-After`. |\n\nO limite por minuto depende do plano. Ao investigar uma falha, guarde o `requestId` da resposta ou o cabeçalho `X-Request-Id` para localizar a requisição.\n\n</details>\n\n## Novos recursos\n\nAs novas rotas usam os mesmos escopos, limites, formato de resposta e paginação. POST exige `Idempotency-Key`. Orçamentos são planos financeiros anuais. Contratos são gerados a partir de propostas aprovadas. Faturas não podem ser marcadas como pagas por PATCH. Consulte cada operação para conhecer filtros e transições aceitas.\n\n## Segunda etapa\n\nEquipe, tarefas, automações, formulários, submissões e landing pages usam os mesmos limites, paginação e erros. Convites exigem users:invite; alterações de papel ou módulos exigem também users:permissions. Ações de publicação e ativação possuem escopos separados. O envio público de formulários não aceita Bearer e possui limite próprio. Definições completas aparecem nas consultas por ID; as listas retornam resumos. Não há execução manual de automação porque o motor atual não oferece essa operação.\n\n## Webhooks\n\nEventos da segunda etapa: `user.invited`, `user.created`, `user.updated`, `task.created`, `task.completed`, `automation.activated`, `automation.failed`, `form.published` e `landing_page.published`. O evento `form.submitted` já existia e continua sendo emitido para contatos novos processados. Configure os eventos nos webhooks do painel; os payloads desta etapa contêm IDs e metadados sem credenciais."
  },
  "servers": [
    {
      "url": "https://api.planejalfa.com.br",
      "description": "Produção"
    },
    {
      "url": "http://localhost:3000",
      "description": "Desenvolvimento local"
    }
  ],
  "security": [
    {
      "BearerKey": []
    }
  ],
  "components": {
    "parameters": {
      "Page": {
        "name": "page",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "default": 1
        },
        "description": "Número da página, começando em 1."
      },
      "PerPage": {
        "name": "perPage",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 20
        },
        "description": "Quantidade de registros por página, até 50."
      },
      "Id": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "Identificador único por tentativa lógica, de 8 a 128 caracteres ASCII. Reutilize ao repetir a mesma criação por até 24 horas.",
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9._:-]+$"
        },
        "example": "contato-site-20260929-001"
      }
    },
    "securitySchemes": {
      "BearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Chave pja_… sem o prefixo Bearer."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "requestId"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "title": "Erro da requisição"
      },
      "Pagination": {
        "type": "object",
        "required": [
          "page",
          "perPage",
          "total",
          "totalPages"
        ],
        "properties": {
          "page": {
            "type": "integer"
          },
          "perPage": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "totalPages": {
            "type": "integer"
          }
        },
        "title": "Paginação"
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Nome completo da pessoa ou razão social da empresa."
          },
          "companyName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Nome da empresa associada ao contato."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "E-mail principal do contato."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Telefone com DDD."
          },
          "whatsapp": {
            "type": [
              "string",
              "null"
            ],
            "description": "Número de WhatsApp com DDD."
          },
          "status": {
            "type": "string",
            "enum": [
              "lead",
              "prospect",
              "customer",
              "inactive"
            ],
            "description": "Etapa do relacionamento: lead (novo), prospect (potencial cliente), customer (cliente) ou inactive (inativo)."
          },
          "type": {
            "type": "string",
            "enum": [
              "person",
              "company"
            ],
            "description": "Use person para pessoa física ou company para empresa."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Origem do contato, como site ou indicação."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "title": "Contato"
      },
      "Deal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "description": "Nome que identifica a oportunidade comercial."
          },
          "value": {
            "type": "string",
            "example": "25000.00"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "won",
              "lost"
            ]
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Identificador do contato vinculado ao negócio."
          },
          "pipelineId": {
            "type": "string",
            "description": "Identificador do funil. Consulte a lista de funis e etapas."
          },
          "stageId": {
            "type": "string",
            "description": "Identificador de uma etapa do funil informado."
          },
          "ownerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Identificador do responsável pelo negócio."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Origem da oportunidade comercial."
          },
          "expectedCloseDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Data prevista de fechamento no formato AAAA-MM-DD."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "title": "Negócio"
      },
      "Pipeline": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "stages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "semanticType": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "title": "Funil e etapas"
      },
      "ContactWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 160,
            "description": "Nome completo da pessoa ou razão social da empresa."
          },
          "companyName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 160,
            "description": "Nome da empresa associada ao contato."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 254,
            "description": "E-mail principal do contato."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Telefone com DDD."
          },
          "whatsapp": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Número de WhatsApp com DDD."
          },
          "status": {
            "type": "string",
            "enum": [
              "lead",
              "prospect",
              "customer",
              "inactive"
            ],
            "description": "Etapa do relacionamento: lead (novo), prospect (potencial cliente), customer (cliente) ou inactive (inativo)."
          },
          "type": {
            "type": "string",
            "enum": [
              "person",
              "company"
            ],
            "description": "Use person para pessoa física ou company para empresa."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Origem do contato, como site ou indicação."
          }
        },
        "examples": [
          {
            "name": "Ana Silva",
            "email": "ana@example.com",
            "phone": "31999990000",
            "type": "person",
            "status": "lead",
            "source": "Site"
          }
        ],
        "title": "Novo contato"
      },
      "ContactPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "updatedAt"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 160,
            "description": "Nome completo da pessoa ou razão social da empresa."
          },
          "companyName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 160,
            "description": "Nome da empresa associada ao contato."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 254,
            "description": "E-mail principal do contato."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Telefone com DDD."
          },
          "whatsapp": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Número de WhatsApp com DDD."
          },
          "status": {
            "type": "string",
            "enum": [
              "lead",
              "prospect",
              "customer",
              "inactive"
            ],
            "description": "Etapa do relacionamento: lead (novo), prospect (potencial cliente), customer (cliente) ou inactive (inativo)."
          },
          "type": {
            "type": "string",
            "enum": [
              "person",
              "company"
            ],
            "description": "Use person para pessoa física ou company para empresa."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Origem do contato, como site ou indicação."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Copie o valor exato retornado na consulta mais recente. Usado para evitar sobrescrever alterações de outra pessoa."
          }
        },
        "examples": [
          {
            "name": "Ana Silva Santos",
            "updatedAt": "2026-09-29T12:00:00.000Z"
          }
        ],
        "title": "Atualização de contato"
      },
      "DealWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "pipelineId",
          "stageId"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Nome que identifica a oportunidade comercial."
          },
          "pipelineId": {
            "type": "string",
            "format": "uuid",
            "description": "Identificador do funil. Consulte a lista de funis e etapas."
          },
          "stageId": {
            "type": "string",
            "format": "uuid",
            "description": "Identificador de uma etapa do funil informado."
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Identificador do contato vinculado ao negócio."
          },
          "ownerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Identificador do responsável pelo negócio."
          },
          "value": {
            "type": "string",
            "pattern": "^[0-9]{1,12}(\\.[0-9]{1,2})?$",
            "description": "Valor decimal em reais. Use ponto como separador, sem símbolo de moeda."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Origem da oportunidade comercial."
          },
          "expectedCloseDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Data prevista de fechamento no formato AAAA-MM-DD."
          }
        },
        "examples": [
          {
            "title": "Cozinha planejada — Ana Silva",
            "pipelineId": "11111111-1111-4111-8111-111111111111",
            "stageId": "22222222-2222-4222-8222-222222222222",
            "value": "12500.00",
            "source": "Site"
          }
        ],
        "title": "Novo negócio"
      },
      "DealPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "updatedAt"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Nome que identifica a oportunidade comercial."
          },
          "pipelineId": {
            "type": "string",
            "format": "uuid",
            "description": "Identificador do funil. Consulte a lista de funis e etapas."
          },
          "stageId": {
            "type": "string",
            "format": "uuid",
            "description": "Identificador de uma etapa do funil informado."
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Identificador do contato vinculado ao negócio."
          },
          "ownerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Identificador do responsável pelo negócio."
          },
          "value": {
            "type": "string",
            "pattern": "^[0-9]{1,12}(\\.[0-9]{1,2})?$",
            "description": "Valor decimal em reais. Use ponto como separador, sem símbolo de moeda."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Origem da oportunidade comercial."
          },
          "expectedCloseDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Data prevista de fechamento no formato AAAA-MM-DD."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Copie o valor exato retornado na consulta mais recente. Usado para evitar sobrescrever alterações de outra pessoa."
          }
        },
        "examples": [
          {
            "value": "13900.00",
            "updatedAt": "2026-09-29T12:00:00.000Z"
          }
        ],
        "title": "Atualização de negócio"
      },
      "Proposal": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "proposalNumber": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "sent",
              "viewed",
              "under_negotiation",
              "approved",
              "rejected",
              "expired",
              "cancelled"
            ]
          },
          "contactId": {
            "type": "string",
            "format": "uuid"
          },
          "dealId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sellerUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "validUntil": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "versionNumber": {
                  "type": "integer"
                },
                "subtotal": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "discountAmount": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "additionalAmount": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "totalAmount": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "sections": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "subtotal": {
                        "type": "string",
                        "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                        "example": "1250.00"
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "catalogItemId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "quantity": {
                              "type": "string",
                              "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                              "example": "1250.00"
                            },
                            "unitPrice": {
                              "type": "string",
                              "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                              "example": "1250.00"
                            },
                            "discountAmount": {
                              "type": "string",
                              "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                              "example": "1250.00"
                            },
                            "totalAmount": {
                              "type": "string",
                              "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                              "example": "1250.00"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "paymentTerms": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "label": {
                        "type": "string"
                      },
                      "percent": {
                        "type": "string",
                        "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                        "example": "1250.00"
                      },
                      "amount": {
                        "type": "string",
                        "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                        "example": "1250.00"
                      },
                      "dueDate": {
                        "type": "string",
                        "format": "date"
                      },
                      "method": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProposalCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string"
          },
          "contactId": {
            "type": "string",
            "format": "uuid"
          },
          "dealId": {
            "type": "string",
            "format": "uuid"
          },
          "sellerUserId": {
            "type": "string",
            "format": "uuid"
          },
          "notes": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "contactId"
        ]
      },
      "ProposalPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string"
          },
          "sections": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "quantity": {
                        "type": "string",
                        "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                        "example": "1250.00"
                      },
                      "unit": {
                        "type": "string"
                      },
                      "unitPrice": {
                        "type": "string",
                        "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                        "example": "1250.00"
                      },
                      "discountAmount": {
                        "type": "string",
                        "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                        "example": "1250.00"
                      },
                      "catalogItemId": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "name",
                      "quantity",
                      "unitPrice"
                    ]
                  }
                }
              },
              "required": [
                "name",
                "items"
              ]
            }
          },
          "paymentTerms": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "label": {
                  "type": "string"
                },
                "percent": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "dueDate": {
                  "type": "string",
                  "format": "date"
                },
                "method": {
                  "type": "string"
                }
              }
            }
          },
          "discountType": {
            "type": "string",
            "enum": [
              "amount",
              "percent"
            ]
          },
          "discountPercent": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "discountAmount": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "additionalAmount": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "priceListId": {
            "type": "string",
            "format": "uuid"
          },
          "validUntil": {
            "type": "string",
            "format": "date"
          },
          "deliveryDays": {
            "type": "integer"
          },
          "notes": {
            "type": "string"
          },
          "termsText": {
            "type": "string"
          }
        },
        "required": [
          "sections",
          "paymentTerms"
        ]
      },
      "Contract": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "contractNumber": {
            "type": "string"
          },
          "proposalId": {
            "type": "string",
            "format": "uuid"
          },
          "versionId": {
            "type": "string",
            "format": "uuid"
          },
          "contactId": {
            "type": "string",
            "format": "uuid"
          },
          "dealId": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "generated",
              "sent",
              "signed",
              "signed_externally",
              "cancelled"
            ]
          },
          "contractValue": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "bodySnapshot": {
            "type": [
              "string",
              "null"
            ]
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "sentAt": {
            "type": "string",
            "format": "date-time"
          },
          "signedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ContractCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "proposalId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "proposalId"
        ]
      },
      "ContractPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "send",
              "sign",
              "cancel"
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "action"
        ]
      },
      "CalendarEvent": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "confirmed",
              "in_progress",
              "completed",
              "cancelled",
              "no_show"
            ]
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time"
          },
          "allDay": {
            "type": "boolean"
          },
          "assignedTo": {
            "type": [
              "string",
              "null"
            ]
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ]
          },
          "dealId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CalendarEventCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string"
          },
          "typeId": {
            "type": "string",
            "format": "uuid"
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time"
          },
          "allDay": {
            "type": "boolean"
          },
          "assignedTo": {
            "type": "string",
            "format": "uuid"
          },
          "contactId": {
            "type": "string",
            "format": "uuid"
          },
          "dealId": {
            "type": "string",
            "format": "uuid"
          },
          "description": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "address": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "typeId",
          "startsAt",
          "endsAt",
          "assignedTo"
        ]
      },
      "CalendarEventPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string"
          },
          "typeId": {
            "type": "string",
            "format": "uuid"
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time"
          },
          "allDay": {
            "type": "boolean"
          },
          "assignedTo": {
            "type": "string",
            "format": "uuid"
          },
          "contactId": {
            "type": "string",
            "format": "uuid"
          },
          "dealId": {
            "type": "string",
            "format": "uuid"
          },
          "description": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "enum": [
              "status",
              "reschedule"
            ]
          },
          "status": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "Project": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "projectNumber": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "contactId": {
            "type": "string",
            "format": "uuid"
          },
          "dealId": {
            "type": [
              "string",
              "null"
            ]
          },
          "statusId": {
            "type": "string",
            "format": "uuid"
          },
          "responsibleUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "priority": {
            "type": "string"
          },
          "contractValueSnapshot": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "expectedStartDate": {
            "type": "string",
            "format": "date"
          },
          "expectedDeliveryDate": {
            "type": "string",
            "format": "date"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "contactId": {
            "type": "string",
            "format": "uuid"
          },
          "dealId": {
            "type": "string",
            "format": "uuid"
          },
          "statusId": {
            "type": "string",
            "format": "uuid"
          },
          "responsibleId": {
            "type": "string",
            "format": "uuid"
          },
          "sellerId": {
            "type": "string",
            "format": "uuid"
          },
          "designerId": {
            "type": "string",
            "format": "uuid"
          },
          "priority": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high",
              "urgent"
            ]
          },
          "value": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "deliveryDate": {
            "type": "string",
            "format": "date"
          },
          "notes": {
            "type": "string"
          },
          "rooms": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ]
            }
          }
        },
        "required": [
          "name",
          "contactId"
        ]
      },
      "ProjectPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "statusId": {
            "type": "string",
            "format": "uuid"
          },
          "responsibleId": {
            "type": "string",
            "format": "uuid"
          },
          "sellerId": {
            "type": "string",
            "format": "uuid"
          },
          "designerId": {
            "type": "string",
            "format": "uuid"
          },
          "priority": {
            "type": "string"
          },
          "value": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "deliveryDate": {
            "type": "string",
            "format": "date"
          },
          "notes": {
            "type": "string"
          },
          "statusNote": {
            "type": "string"
          }
        }
      },
      "CatalogItem": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "PRODUCT",
              "SERVICE"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "categoryId": {
            "type": [
              "string",
              "null"
            ]
          },
          "unitId": {
            "type": [
              "string",
              "null"
            ]
          },
          "basePrice": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                "example": "1250.00"
              },
              {
                "type": "null"
              }
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CatalogItemCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "PRODUCT",
              "SERVICE"
            ]
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "categoryId": {
            "type": "string",
            "format": "uuid"
          },
          "unitId": {
            "type": "string",
            "format": "uuid"
          },
          "basePrice": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "type",
          "name"
        ]
      },
      "CatalogItemPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "PRODUCT",
              "SERVICE"
            ]
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "categoryId": {
            "type": "string",
            "format": "uuid"
          },
          "unitId": {
            "type": "string",
            "format": "uuid"
          },
          "basePrice": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "Budget": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "year": {
            "type": "integer"
          },
          "version": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "ACTIVE",
              "CLOSED",
              "ARCHIVED"
            ]
          },
          "revisedFrom": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "month": {
                  "type": "integer"
                },
                "categoryId": {
                  "type": "string",
                  "format": "uuid"
                },
                "managementCenterId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "projectId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "amount": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "notes": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "BudgetCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "minimum": 2000,
            "maximum": 2100
          },
          "copyFrom": {
            "type": "string",
            "format": "uuid"
          },
          "adjustPct": {
            "type": "number"
          }
        },
        "required": [
          "name",
          "year"
        ]
      },
      "BudgetPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "save",
              "status"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "ARCHIVED"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "month": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 12
                },
                "categoryId": {
                  "type": "string",
                  "format": "uuid"
                },
                "centerId": {
                  "type": "string",
                  "format": "uuid"
                },
                "projectId": {
                  "type": "string",
                  "format": "uuid"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                }
              },
              "required": [
                "month",
                "categoryId",
                "amount"
              ]
            }
          }
        },
        "required": [
          "action"
        ]
      },
      "Invoice": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "partial",
              "paid",
              "overdue",
              "cancelled"
            ]
          },
          "currency": {
            "type": "string"
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ]
          },
          "dealId": {
            "type": [
              "string",
              "null"
            ]
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "dueDate": {
            "type": "string",
            "format": "date"
          },
          "subtotal": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "discountAmount": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "taxAmount": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "total": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "unitPrice": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "total": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "position": {
                  "type": "integer"
                }
              }
            }
          },
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "paidAmount": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "dueDate": {
                  "type": "string",
                  "format": "date"
                },
                "status": {
                  "type": "string"
                },
                "installmentNumber": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "InvoiceCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "contactId": {
            "type": "string",
            "format": "uuid"
          },
          "dealId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "pending"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "unitPrice": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPrice"
              ]
            }
          },
          "discount": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "example": "1250.00"
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "dueDate": {
            "type": "string",
            "format": "date"
          },
          "installments": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "amount": {
                  "type": "string",
                  "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
                  "example": "1250.00"
                },
                "dueDate": {
                  "type": "string",
                  "format": "date"
                },
                "description": {
                  "type": "string"
                }
              },
              "required": [
                "amount",
                "dueDate"
              ]
            }
          },
          "notes": {
            "type": "string"
          }
        },
        "required": [
          "contactId",
          "status",
          "items",
          "issueDate",
          "installments"
        ]
      },
      "InvoicePatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "cancel"
            ]
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "action"
        ]
      },
      "User": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "avatar": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "manager",
              "salesperson",
              "finance",
              "viewer"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "moduleAccess": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "userId",
          "name",
          "email",
          "role",
          "active"
        ]
      },
      "UserCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "manager",
              "salesperson",
              "finance",
              "viewer"
            ]
          },
          "moduleAccess": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "email",
          "role"
        ]
      },
      "UserPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "manager",
              "salesperson",
              "finance",
              "viewer"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "moduleAccess": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "TeamInvitation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "manager",
              "salesperson",
              "finance",
              "viewer"
            ]
          },
          "moduleAccess": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "createdAt",
          "expiresAt"
        ]
      },
      "Task": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "priority": {
            "type": "string",
            "enum": [
              "LOW",
              "NORMAL",
              "HIGH",
              "URGENT"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "COMPLETED"
            ]
          },
          "assigneeId": {
            "type": "string",
            "format": "uuid"
          },
          "createdById": {
            "type": "string",
            "format": "uuid"
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "completedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "title",
          "priority",
          "status",
          "assigneeId"
        ]
      },
      "TaskCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "assigneeId": {
            "type": "string",
            "format": "uuid"
          },
          "priority": {
            "type": "string",
            "enum": [
              "LOW",
              "NORMAL",
              "HIGH",
              "URGENT"
            ]
          },
          "dueAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "title"
        ]
      },
      "TaskPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "complete",
              "reopen",
              "snooze"
            ]
          },
          "dueAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "action"
        ]
      },
      "Automation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "triggerType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer"
          },
          "lastRunAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "flow": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "triggerConfig": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "id",
          "name",
          "status"
        ]
      },
      "AutomationCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "template": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      },
      "AutomationPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "triggerType": {
            "type": "string"
          },
          "triggerConfig": {
            "type": "object"
          },
          "flow": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "AutomationExecution": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "automationId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "attempts": {
            "type": "integer"
          },
          "resumeAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "automationId",
          "status"
        ]
      },
      "FormField": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "placeholder": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "key",
          "label",
          "type"
        ]
      },
      "Form": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PUBLISHED",
              "ARCHIVED"
            ]
          },
          "draftDefinition": {
            "type": "object",
            "additionalProperties": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "status"
        ]
      },
      "FormCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "templateKey": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      },
      "FormPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "definition": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "fields": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FormField"
                }
              }
            }
          },
          "submitLabel": {
            "type": "string"
          },
          "successMessage": {
            "type": "string"
          },
          "consentRequired": {
            "type": "boolean"
          },
          "consentText": {
            "type": "string"
          }
        }
      },
      "FormSubmission": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "formId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "values": {
            "type": "object",
            "additionalProperties": true
          },
          "contactId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "dealId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "isNewContact": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "processedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "formId",
          "status",
          "values"
        ]
      },
      "FormSubmissionCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "values": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            }
          },
          "consent": {
            "type": "boolean"
          },
          "website": {
            "type": "string"
          },
          "landingUrl": {
            "type": "string"
          }
        },
        "required": [
          "values"
        ]
      },
      "LandingPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PUBLISHED",
              "UNPUBLISHED",
              "ARCHIVED"
            ]
          },
          "revision": {
            "type": "integer"
          },
          "templateKey": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "draftDefinition": {
            "type": "object",
            "additionalProperties": true
          },
          "publishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "status",
          "revision"
        ]
      },
      "LandingPageCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "templateKey": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      },
      "LandingPagePatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "revision": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "definition": {
            "type": "object",
            "additionalProperties": true
          },
          "campaignId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "domainId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "revision"
        ]
      },
      "LandingPageTemplate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "previewImageUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "definition": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "key",
          "name"
        ]
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Chave ausente, revogada ou expirada",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Escopo, acesso do criador ou plano insuficiente",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Limite por minuto atingido. Consulte Retry-After.",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflito de versão, duplicidade ou uso diferente de Idempotency-Key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "Campo inválido ou regra de negócio não atendida",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1/me": {
      "get": {
        "summary": "Dados da credencial e empresa",
        "operationId": "getMe",
        "responses": {
          "200": {
            "description": "Empresa e chave sem segredo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "organization": {
                          "type": "object"
                        },
                        "key": {
                          "type": "object"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "tags": [
          "Conexão"
        ],
        "description": "Aceita qualquer chave válida. Retorna os dados da credencial e da empresa, sem revelar o segredo."
      }
    },
    "/v1/contacts": {
      "get": {
        "summary": "Listar contatos",
        "operationId": "listContacts",
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "lead",
                "prospect",
                "customer",
                "inactive"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista paginada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Contact"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "tags": [
          "Contatos"
        ],
        "description": "**Permissão necessária:** `contacts:read`. O acesso também depende do plano e das permissões do criador da chave.\n\nUse `page` e `perPage` para percorrer os resultados. Os filtros disponíveis estão descritos abaixo."
      },
      "post": {
        "summary": "Criar contato",
        "operationId": "createContact",
        "x-required-scope": "contacts:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactWrite"
              },
              "example": {
                "name": "Ana Silva",
                "email": "ana@example.com",
                "phone": "31999990000",
                "type": "person",
                "status": "lead",
                "source": "Site"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado ou repetição idempotente",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Contact"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Chave de idempotência ausente ou campos não permitidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "tags": [
          "Contatos"
        ],
        "description": "**Permissão necessária:** `contacts:write`. O acesso também depende do plano e das permissões do criador da chave.\n\nEnvie `Idempotency-Key` para proteger a criação contra duplicidades em novas tentativas. Reutilize a mesma chave somente com o mesmo corpo por até 24 horas."
      }
    },
    "/v1/contacts/{id}": {
      "get": {
        "summary": "Consultar contato",
        "operationId": "getContact",
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Contato",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Contact"
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Contato não encontrado"
          }
        },
        "tags": [
          "Contatos"
        ],
        "description": "**Permissão necessária:** `contacts:read`. O acesso também depende do plano e das permissões do criador da chave.\n\nRetorna um registro da empresa vinculada à chave. Guarde `updatedAt` caso precise atualizá-lo depois."
      },
      "patch": {
        "summary": "Editar contato",
        "operationId": "updateContact",
        "x-required-scope": "contacts:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactPatch"
              },
              "example": {
                "name": "Ana Silva Santos",
                "updatedAt": "2026-09-29T12:00:00.000Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Contact"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "tags": [
          "Contatos"
        ],
        "description": "**Permissão necessária:** `contacts:write`. O acesso também depende do plano e das permissões do criador da chave.\n\nEnvie apenas os campos a alterar e o `updatedAt` retornado na última consulta. Um registro alterado desde então gera conflito (409)."
      }
    },
    "/v1/deals": {
      "get": {
        "summary": "Listar negócios",
        "operationId": "listDeals",
        "x-required-scope": "deals:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "won",
                "lost"
              ]
            }
          },
          {
            "name": "pipelineId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stageId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista paginada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Deal"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "tags": [
          "Negócios"
        ],
        "description": "**Permissão necessária:** `deals:read`. O acesso também depende do plano e das permissões do criador da chave.\n\nUse `page` e `perPage` para percorrer os resultados. Os filtros disponíveis estão descritos abaixo."
      },
      "post": {
        "summary": "Criar negócio",
        "operationId": "createDeal",
        "x-required-scope": "deals:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealWrite"
              },
              "example": {
                "title": "Cozinha planejada — Ana Silva",
                "pipelineId": "11111111-1111-4111-8111-111111111111",
                "stageId": "22222222-2222-4222-8222-222222222222",
                "value": "12500.00",
                "source": "Site"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado ou repetição idempotente",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Deal"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Chave de idempotência ausente ou campos não permitidos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "tags": [
          "Negócios"
        ],
        "description": "**Permissão necessária:** `deals:write`. O acesso também depende do plano e das permissões do criador da chave.\n\nEnvie `Idempotency-Key` para proteger a criação contra duplicidades em novas tentativas. Reutilize a mesma chave somente com o mesmo corpo por até 24 horas.\n\nConsulte `GET /v1/pipelines` para obter `pipelineId` e `stageId`. O status do negócio é determinado pela etapa."
      }
    },
    "/v1/deals/{id}": {
      "get": {
        "summary": "Consultar negócio",
        "operationId": "getDeal",
        "x-required-scope": "deals:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Negócio",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Deal"
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Negócio não encontrado"
          }
        },
        "tags": [
          "Negócios"
        ],
        "description": "**Permissão necessária:** `deals:read`. O acesso também depende do plano e das permissões do criador da chave.\n\nRetorna um registro da empresa vinculada à chave. Guarde `updatedAt` caso precise atualizá-lo depois."
      },
      "patch": {
        "summary": "Editar negócio",
        "operationId": "updateDeal",
        "x-required-scope": "deals:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealPatch"
              },
              "example": {
                "value": "13900.00",
                "updatedAt": "2026-09-29T12:00:00.000Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Deal"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "tags": [
          "Negócios"
        ],
        "description": "**Permissão necessária:** `deals:write`. O acesso também depende do plano e das permissões do criador da chave.\n\nEnvie apenas os campos a alterar e o `updatedAt` retornado na última consulta. Um registro alterado desde então gera conflito (409)."
      }
    },
    "/v1/pipelines": {
      "get": {
        "summary": "Listar funis e etapas",
        "operationId": "listPipelines",
        "x-required-scope": "pipelines:read",
        "responses": {
          "200": {
            "description": "Funis ativos",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Pipeline"
                          }
                        }
                      }
                    },
                    "requestId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "tags": [
          "Funis e etapas"
        ],
        "description": "**Permissão necessária:** `pipelines:read`. O acesso também depende do plano e das permissões do criador da chave.\n\nUse `page` e `perPage` para percorrer os resultados. Os filtros disponíveis estão descritos abaixo."
      }
    },
    "/v1/proposals": {
      "get": {
        "tags": [
          "Propostas"
        ],
        "description": "**Escopo:** `proposals:read`. POST cria um rascunho. PATCH salva a versão em rascunho e recalcula subtotal, descontos e total no serviço de propostas. DELETE segue a regra de exclusão do domínio e rejeita propostas com contratos.",
        "x-required-scope": "proposals:read",
        "summary": "Listar propostas",
        "operationId": "listProposals",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "contactId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dealId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "ownerId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista paginada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Proposal"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Propostas"
        ],
        "description": "**Escopo:** `proposals:write`. POST cria um rascunho. PATCH salva a versão em rascunho e recalcula subtotal, descontos e total no serviço de propostas. DELETE segue a regra de exclusão do domínio e rejeita propostas com contratos.",
        "x-required-scope": "proposals:write",
        "summary": "Criar propostas",
        "operationId": "createProposal",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProposalCreate"
              },
              "example": {
                "title": "Projeto comercial",
                "contactId": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/proposals/{id}": {
      "get": {
        "tags": [
          "Propostas"
        ],
        "description": "**Escopo:** `proposals:read`. POST cria um rascunho. PATCH salva a versão em rascunho e recalcula subtotal, descontos e total no serviço de propostas. DELETE segue a regra de exclusão do domínio e rejeita propostas com contratos.",
        "x-required-scope": "proposals:read",
        "summary": "Consultar propostas",
        "operationId": "getProposal",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Registro",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Proposal"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Propostas"
        ],
        "description": "**Escopo:** `proposals:write`. POST cria um rascunho. PATCH salva a versão em rascunho e recalcula subtotal, descontos e total no serviço de propostas. DELETE segue a regra de exclusão do domínio e rejeita propostas com contratos.",
        "x-required-scope": "proposals:write",
        "summary": "Atualizar propostas",
        "operationId": "patchProposal",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProposalPatch"
              },
              "example": {
                "title": "Projeto comercial",
                "sections": [
                  {
                    "name": "Sala",
                    "items": [
                      {
                        "name": "Painel",
                        "quantity": "2",
                        "unitPrice": "500.00"
                      }
                    ]
                  }
                ],
                "paymentTerms": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Propostas"
        ],
        "description": "**Escopo:** `proposals:write`. POST cria um rascunho. PATCH salva a versão em rascunho e recalcula subtotal, descontos e total no serviço de propostas. DELETE segue a regra de exclusão do domínio e rejeita propostas com contratos.",
        "x-required-scope": "proposals:write",
        "summary": "Excluir ou arquivar propostas",
        "operationId": "deleteProposal",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Excluído ou arquivado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/contracts": {
      "get": {
        "tags": [
          "Contratos"
        ],
        "description": "**Escopo:** `contracts:read`. Contratos são gerados a partir de uma proposta aprovada; o domínio gera número, texto e valor. PATCH permite apenas as transições send, sign e cancel. Assinaturas digitais em andamento bloqueiam transições manuais. Não há exclusão direta.",
        "x-required-scope": "contracts:read",
        "summary": "Listar contratos",
        "operationId": "listContracts",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "contactId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "proposalId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista paginada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Contract"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Contratos"
        ],
        "description": "**Escopo:** `contracts:write`. Contratos são gerados a partir de uma proposta aprovada; o domínio gera número, texto e valor. PATCH permite apenas as transições send, sign e cancel. Assinaturas digitais em andamento bloqueiam transições manuais. Não há exclusão direta.",
        "x-required-scope": "contracts:write",
        "summary": "Criar contratos",
        "operationId": "createContract",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContractCreate"
              },
              "example": {
                "proposalId": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/contracts/{id}": {
      "get": {
        "tags": [
          "Contratos"
        ],
        "description": "**Escopo:** `contracts:read`. Contratos são gerados a partir de uma proposta aprovada; o domínio gera número, texto e valor. PATCH permite apenas as transições send, sign e cancel. Assinaturas digitais em andamento bloqueiam transições manuais. Não há exclusão direta.",
        "x-required-scope": "contracts:read",
        "summary": "Consultar contratos",
        "operationId": "getContract",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Registro",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Contract"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Contratos"
        ],
        "description": "**Escopo:** `contracts:write`. Contratos são gerados a partir de uma proposta aprovada; o domínio gera número, texto e valor. PATCH permite apenas as transições send, sign e cancel. Assinaturas digitais em andamento bloqueiam transições manuais. Não há exclusão direta.",
        "x-required-scope": "contracts:write",
        "summary": "Atualizar contratos",
        "operationId": "patchContract",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContractPatch"
              },
              "example": {
                "action": "send"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/calendar": {
      "get": {
        "tags": [
          "Agenda"
        ],
        "description": "**Escopo:** `calendar:read`. Use ISO 8601 com fuso explícito. PATCH com action=status ou reschedule executa as transições do serviço; sem action, envia todos os campos obrigatórios para substituir o compromisso. DELETE faz soft delete.",
        "x-required-scope": "calendar:read",
        "summary": "Listar agenda",
        "operationId": "listCalendarEvents",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "contactId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dealId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "ownerId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "start",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "end",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista paginada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CalendarEvent"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Agenda"
        ],
        "description": "**Escopo:** `calendar:write`. Use ISO 8601 com fuso explícito. PATCH com action=status ou reschedule executa as transições do serviço; sem action, envia todos os campos obrigatórios para substituir o compromisso. DELETE faz soft delete.",
        "x-required-scope": "calendar:write",
        "summary": "Criar agenda",
        "operationId": "createCalendarEvent",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarEventCreate"
              },
              "example": {
                "title": "Reunião",
                "typeId": "00000000-0000-4000-8000-000000000001",
                "assignedTo": "00000000-0000-4000-8000-000000000002",
                "startsAt": "2026-10-01T13:00:00Z",
                "endsAt": "2026-10-01T14:00:00Z"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/calendar/{id}": {
      "get": {
        "tags": [
          "Agenda"
        ],
        "description": "**Escopo:** `calendar:read`. Use ISO 8601 com fuso explícito. PATCH com action=status ou reschedule executa as transições do serviço; sem action, envia todos os campos obrigatórios para substituir o compromisso. DELETE faz soft delete.",
        "x-required-scope": "calendar:read",
        "summary": "Consultar agenda",
        "operationId": "getCalendarEvent",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Registro",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalendarEvent"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Agenda"
        ],
        "description": "**Escopo:** `calendar:write`. Use ISO 8601 com fuso explícito. PATCH com action=status ou reschedule executa as transições do serviço; sem action, envia todos os campos obrigatórios para substituir o compromisso. DELETE faz soft delete.",
        "x-required-scope": "calendar:write",
        "summary": "Atualizar agenda",
        "operationId": "patchCalendarEvent",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarEventPatch"
              },
              "example": {
                "action": "reschedule",
                "startsAt": "2026-10-02T13:00:00Z",
                "endsAt": "2026-10-02T14:00:00Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Agenda"
        ],
        "description": "**Escopo:** `calendar:write`. Use ISO 8601 com fuso explícito. PATCH com action=status ou reschedule executa as transições do serviço; sem action, envia todos os campos obrigatórios para substituir o compromisso. DELETE faz soft delete.",
        "x-required-scope": "calendar:write",
        "summary": "Excluir ou arquivar agenda",
        "operationId": "deleteCalendarEvent",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Excluído ou arquivado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/projects": {
      "get": {
        "tags": [
          "Projetos"
        ],
        "description": "**Escopo:** `projects:read`. O serviço valida contato, negócio, responsáveis, status e limite do plano. DELETE arquiva o projeto.",
        "x-required-scope": "projects:read",
        "summary": "Listar projetos",
        "operationId": "listProjects",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "statusId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "contactId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dealId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "ownerId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "priority",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista paginada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Project"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Projetos"
        ],
        "description": "**Escopo:** `projects:write`. O serviço valida contato, negócio, responsáveis, status e limite do plano. DELETE arquiva o projeto.",
        "x-required-scope": "projects:write",
        "summary": "Criar projetos",
        "operationId": "createProject",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCreate"
              },
              "example": {
                "name": "Projeto de interiores",
                "contactId": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/projects/{id}": {
      "get": {
        "tags": [
          "Projetos"
        ],
        "description": "**Escopo:** `projects:read`. O serviço valida contato, negócio, responsáveis, status e limite do plano. DELETE arquiva o projeto.",
        "x-required-scope": "projects:read",
        "summary": "Consultar projetos",
        "operationId": "getProject",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Registro",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Projetos"
        ],
        "description": "**Escopo:** `projects:write`. O serviço valida contato, negócio, responsáveis, status e limite do plano. DELETE arquiva o projeto.",
        "x-required-scope": "projects:write",
        "summary": "Atualizar projetos",
        "operationId": "patchProject",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectPatch"
              },
              "example": {
                "priority": "high"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Projetos"
        ],
        "description": "**Escopo:** `projects:write`. O serviço valida contato, negócio, responsáveis, status e limite do plano. DELETE arquiva o projeto.",
        "x-required-scope": "projects:write",
        "summary": "Excluir ou arquivar projetos",
        "operationId": "deleteProject",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Excluído ou arquivado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/catalog": {
      "get": {
        "tags": [
          "Catálogo"
        ],
        "description": "**Escopo:** `catalog:read`. Preço é Decimal no domínio. PATCH preserva campos omitidos; DELETE arquiva o item.",
        "x-required-scope": "catalog:read",
        "summary": "Listar catálogo",
        "operationId": "listCatalogItems",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "categoryId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista paginada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CatalogItem"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Catálogo"
        ],
        "description": "**Escopo:** `catalog:write`. Preço é Decimal no domínio. PATCH preserva campos omitidos; DELETE arquiva o item.",
        "x-required-scope": "catalog:write",
        "summary": "Criar catálogo",
        "operationId": "createCatalogItem",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogItemCreate"
              },
              "example": {
                "type": "PRODUCT",
                "name": "Painel planejado",
                "basePrice": "1250.00"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/catalog/{id}": {
      "get": {
        "tags": [
          "Catálogo"
        ],
        "description": "**Escopo:** `catalog:read`. Preço é Decimal no domínio. PATCH preserva campos omitidos; DELETE arquiva o item.",
        "x-required-scope": "catalog:read",
        "summary": "Consultar catálogo",
        "operationId": "getCatalogItem",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Registro",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CatalogItem"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Catálogo"
        ],
        "description": "**Escopo:** `catalog:write`. Preço é Decimal no domínio. PATCH preserva campos omitidos; DELETE arquiva o item.",
        "x-required-scope": "catalog:write",
        "summary": "Atualizar catálogo",
        "operationId": "patchCatalogItem",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogItemPatch"
              },
              "example": {
                "basePrice": "1350.00"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Catálogo"
        ],
        "description": "**Escopo:** `catalog:write`. Preço é Decimal no domínio. PATCH preserva campos omitidos; DELETE arquiva o item.",
        "x-required-scope": "catalog:write",
        "summary": "Excluir ou arquivar catálogo",
        "operationId": "deleteCatalogItem",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Excluído ou arquivado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/budgets": {
      "get": {
        "tags": [
          "Orçamentos financeiros"
        ],
        "description": "**Escopo:** `budgets:read`. Representa o orçamento gerencial anual existente no financeiro, com linhas por mês e categoria. Não é uma cotação comercial. PATCH salva linhas ou muda o status conforme as regras do serviço. DELETE só é permitido quando o orçamento não está vinculado a fechamento da DRE.",
        "x-required-scope": "budgets:read",
        "summary": "Listar orçamentos financeiros",
        "operationId": "listBudgets",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista paginada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Budget"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Orçamentos financeiros"
        ],
        "description": "**Escopo:** `budgets:write`. Representa o orçamento gerencial anual existente no financeiro, com linhas por mês e categoria. Não é uma cotação comercial. PATCH salva linhas ou muda o status conforme as regras do serviço. DELETE só é permitido quando o orçamento não está vinculado a fechamento da DRE.",
        "x-required-scope": "budgets:write",
        "summary": "Criar orçamentos financeiros",
        "operationId": "createBudget",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetCreate"
              },
              "example": {
                "name": "Planejamento 2027",
                "year": 2027
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/budgets/{id}": {
      "get": {
        "tags": [
          "Orçamentos financeiros"
        ],
        "description": "**Escopo:** `budgets:read`. Representa o orçamento gerencial anual existente no financeiro, com linhas por mês e categoria. Não é uma cotação comercial. PATCH salva linhas ou muda o status conforme as regras do serviço. DELETE só é permitido quando o orçamento não está vinculado a fechamento da DRE.",
        "x-required-scope": "budgets:read",
        "summary": "Consultar orçamentos financeiros",
        "operationId": "getBudget",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Registro",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Budget"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Orçamentos financeiros"
        ],
        "description": "**Escopo:** `budgets:write`. Representa o orçamento gerencial anual existente no financeiro, com linhas por mês e categoria. Não é uma cotação comercial. PATCH salva linhas ou muda o status conforme as regras do serviço. DELETE só é permitido quando o orçamento não está vinculado a fechamento da DRE.",
        "x-required-scope": "budgets:write",
        "summary": "Atualizar orçamentos financeiros",
        "operationId": "patchBudget",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetPatch"
              },
              "example": {
                "action": "save",
                "lines": [
                  {
                    "month": 1,
                    "categoryId": "00000000-0000-4000-8000-000000000001",
                    "amount": "5000.00"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Orçamentos financeiros"
        ],
        "description": "**Escopo:** `budgets:write`. Representa o orçamento gerencial anual existente no financeiro, com linhas por mês e categoria. Não é uma cotação comercial. PATCH salva linhas ou muda o status conforme as regras do serviço. DELETE só é permitido quando o orçamento não está vinculado a fechamento da DRE.",
        "x-required-scope": "budgets:write",
        "summary": "Excluir ou arquivar orçamentos financeiros",
        "operationId": "deleteBudget",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Excluído ou arquivado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/invoices": {
      "get": {
        "tags": [
          "Faturas"
        ],
        "description": "**Escopo:** `invoices:read`. O serviço cria número, itens e parcelas em transação e calcula os totais. PATCH permite somente cancelamento após verificar pagamentos. Para baixa, use o fluxo financeiro do painel; não é possível marcar como paga nesta API. Não há exclusão direta.",
        "x-required-scope": "invoices:read",
        "summary": "Listar faturas",
        "operationId": "listInvoices",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "contactId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dealId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dueFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dueTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista paginada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Faturas"
        ],
        "description": "**Escopo:** `invoices:write`. O serviço cria número, itens e parcelas em transação e calcula os totais. PATCH permite somente cancelamento após verificar pagamentos. Para baixa, use o fluxo financeiro do painel; não é possível marcar como paga nesta API. Não há exclusão direta.",
        "x-required-scope": "invoices:write",
        "summary": "Criar faturas",
        "operationId": "createInvoice",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceCreate"
              },
              "example": {
                "contactId": "00000000-0000-4000-8000-000000000001",
                "status": "pending",
                "items": [
                  {
                    "description": "Serviço",
                    "quantity": "2",
                    "unitPrice": "500.00"
                  }
                ],
                "discount": "0.00",
                "issueDate": "2026-10-01",
                "installments": [
                  {
                    "amount": "1000.00",
                    "dueDate": "2026-10-10"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/invoices/{id}": {
      "get": {
        "tags": [
          "Faturas"
        ],
        "description": "**Escopo:** `invoices:read`. O serviço cria número, itens e parcelas em transação e calcula os totais. PATCH permite somente cancelamento após verificar pagamentos. Para baixa, use o fluxo financeiro do painel; não é possível marcar como paga nesta API. Não há exclusão direta.",
        "x-required-scope": "invoices:read",
        "summary": "Consultar faturas",
        "operationId": "getInvoice",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Registro",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Faturas"
        ],
        "description": "**Escopo:** `invoices:write`. O serviço cria número, itens e parcelas em transação e calcula os totais. PATCH permite somente cancelamento após verificar pagamentos. Para baixa, use o fluxo financeiro do painel; não é possível marcar como paga nesta API. Não há exclusão direta.",
        "x-required-scope": "invoices:write",
        "summary": "Atualizar faturas",
        "operationId": "patchInvoice",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoicePatch"
              },
              "example": {
                "action": "cancel",
                "reason": "Emissão incorreta"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Atualizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/users": {
      "get": {
        "tags": [
          "Equipe"
        ],
        "summary": "Listar equipe",
        "description": "Escopo necessário: users:read.",
        "x-required-scope": "users:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "role",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/User"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "userId": "00000000-0000-4000-8000-000000000001",
                        "name": "Maria Silva",
                        "email": "maria@empresa.com.br",
                        "avatar": null,
                        "role": "salesperson",
                        "active": true,
                        "moduleAccess": null,
                        "createdAt": "2026-09-30T12:00:00.000Z"
                      }
                    ],
                    "pagination": {
                      "page": 1,
                      "perPage": 20,
                      "total": 1,
                      "totalPages": 1
                    }
                  },
                  "requestId": "00000000-0000-4000-8000-000000000001"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Equipe"
        ],
        "summary": "Criar equipe",
        "description": "Escopo necessário: users:invite. Cria convite de equipe; a resposta contém o ID do convite, não de um usuário ativo.",
        "x-required-scope": "users:invite",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserCreate"
              },
              "example": {
                "name": "Maria Silva",
                "email": "maria@empresa.com.br",
                "role": "salesperson"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/users/{id}": {
      "get": {
        "tags": [
          "Equipe"
        ],
        "summary": "Consultar equipe",
        "description": "Escopo necessário: users:read.",
        "x-required-scope": "users:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/User"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Equipe"
        ],
        "summary": "Atualizar equipe",
        "description": "Escopo necessário: users:write. Alterar role ou moduleAccess exige também users:permissions. O serviço impede autoalteração e protege o último proprietário.",
        "x-required-scope": "users:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserPatch"
              },
              "example": {
                "active": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/User"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Equipe"
        ],
        "summary": "Arquivar ou desativar equipe",
        "description": "Escopo necessário: users:write.",
        "x-required-scope": "users:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "ok"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/tasks": {
      "get": {
        "tags": [
          "Tarefas"
        ],
        "summary": "Listar tarefas",
        "description": "Escopo necessário: tasks:read.",
        "x-required-scope": "tasks:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "priority",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assigneeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dueBefore",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dueAfter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "overdue",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Task"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Tarefas"
        ],
        "summary": "Criar tarefas",
        "description": "Escopo necessário: tasks:write.",
        "x-required-scope": "tasks:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskCreate"
              },
              "example": {
                "title": "Ligar para o cliente",
                "priority": "HIGH"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/tasks/{id}": {
      "get": {
        "tags": [
          "Tarefas"
        ],
        "summary": "Consultar tarefas",
        "description": "Escopo necessário: tasks:read.",
        "x-required-scope": "tasks:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Task"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Tarefas"
        ],
        "summary": "Atualizar tarefas",
        "description": "Escopo necessário: tasks:write.",
        "x-required-scope": "tasks:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskPatch"
              },
              "example": {
                "action": "complete"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Task"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "title": "Ligar para o cliente",
                    "description": null,
                    "priority": "HIGH",
                    "status": "COMPLETED",
                    "assigneeId": "00000000-0000-4000-8000-000000000001",
                    "createdById": "00000000-0000-4000-8000-000000000001",
                    "dueAt": null,
                    "completedAt": "2026-09-30T12:00:00.000Z",
                    "createdAt": "2026-09-30T12:00:00.000Z",
                    "updatedAt": "2026-09-30T12:00:00.000Z"
                  },
                  "requestId": "00000000-0000-4000-8000-000000000001"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Tarefas"
        ],
        "summary": "Arquivar ou desativar tarefas",
        "description": "Escopo necessário: tasks:write.",
        "x-required-scope": "tasks:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "ok"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/automations": {
      "get": {
        "tags": [
          "Automações"
        ],
        "summary": "Listar automações",
        "description": "Escopo necessário: automations:read.",
        "x-required-scope": "automations:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "triggerType",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Automation"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "name": "Boas vindas",
                        "description": null,
                        "status": "draft",
                        "triggerType": "form.submitted",
                        "version": 1,
                        "lastRunAt": null,
                        "createdAt": "2026-09-30T12:00:00.000Z",
                        "updatedAt": "2026-09-30T12:00:00.000Z"
                      }
                    ],
                    "pagination": {
                      "page": 1,
                      "perPage": 20,
                      "total": 1,
                      "totalPages": 1
                    }
                  },
                  "requestId": "00000000-0000-4000-8000-000000000001"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Automações"
        ],
        "summary": "Criar automações",
        "description": "Escopo necessário: automations:write.",
        "x-required-scope": "automations:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationCreate"
              },
              "example": {
                "name": "Boas vindas"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/automations/{id}": {
      "get": {
        "tags": [
          "Automações"
        ],
        "summary": "Consultar automações",
        "description": "Escopo necessário: automations:read.",
        "x-required-scope": "automations:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Automation"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Automações"
        ],
        "summary": "Atualizar automações",
        "description": "Escopo necessário: automations:write.",
        "x-required-scope": "automations:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationPatch"
              },
              "example": {
                "name": "Boas vindas atualizada"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Automation"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Automações"
        ],
        "summary": "Arquivar ou desativar automações",
        "description": "Escopo necessário: automations:write.",
        "x-required-scope": "automations:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "ok"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/forms": {
      "get": {
        "tags": [
          "Formulários"
        ],
        "summary": "Listar formulários",
        "description": "Escopo necessário: forms:read.",
        "x-required-scope": "forms:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Form"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Formulários"
        ],
        "summary": "Criar formulários",
        "description": "Escopo necessário: forms:write.",
        "x-required-scope": "forms:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FormCreate"
              },
              "example": {
                "name": "Fale conosco"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/forms/{id}": {
      "get": {
        "tags": [
          "Formulários"
        ],
        "summary": "Consultar formulários",
        "description": "Escopo necessário: forms:read.",
        "x-required-scope": "forms:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Form"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Formulários"
        ],
        "summary": "Atualizar formulários",
        "description": "Escopo necessário: forms:write.",
        "x-required-scope": "forms:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FormPatch"
              },
              "example": {
                "name": "Contato comercial"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Form"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Formulários"
        ],
        "summary": "Arquivar ou desativar formulários",
        "description": "Escopo necessário: forms:write.",
        "x-required-scope": "forms:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "ok"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/landing-pages": {
      "get": {
        "tags": [
          "Landing pages"
        ],
        "summary": "Listar landing pages",
        "description": "Escopo necessário: landing-pages:read.",
        "x-required-scope": "landing-pages:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/LandingPage"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Landing pages"
        ],
        "summary": "Criar landing pages",
        "description": "Escopo necessário: landing-pages:write.",
        "x-required-scope": "landing-pages:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LandingPageCreate"
              },
              "example": {
                "name": "Campanha setembro"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/landing-pages/{id}": {
      "get": {
        "tags": [
          "Landing pages"
        ],
        "summary": "Consultar landing pages",
        "description": "Escopo necessário: landing-pages:read.",
        "x-required-scope": "landing-pages:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LandingPage"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Landing pages"
        ],
        "summary": "Atualizar landing pages",
        "description": "Escopo necessário: landing-pages:write.",
        "x-required-scope": "landing-pages:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LandingPagePatch"
              },
              "example": {
                "revision": 1,
                "name": "Campanha de setembro"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LandingPage"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Landing pages"
        ],
        "summary": "Arquivar ou desativar landing pages",
        "description": "Escopo necessário: landing-pages:write.",
        "x-required-scope": "landing-pages:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "ok"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/users/invitations": {
      "get": {
        "tags": [
          "Equipe"
        ],
        "summary": "Listar equipe",
        "description": "Escopo necessário: users:read.",
        "x-required-scope": "users:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TeamInvitation"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Equipe"
        ],
        "summary": "Criar equipe",
        "description": "Escopo necessário: users:invite.",
        "x-required-scope": "users:invite",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserCreate"
              },
              "example": {
                "name": "Maria Silva",
                "email": "maria@empresa.com.br",
                "role": "salesperson"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Criado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/users/invitations/{id}": {
      "delete": {
        "tags": [
          "Equipe"
        ],
        "summary": "Arquivar ou desativar equipe",
        "description": "Escopo necessário: users:invite.",
        "x-required-scope": "users:invite",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "ok"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/automations/runs": {
      "get": {
        "tags": [
          "Automações"
        ],
        "summary": "Listar automações",
        "description": "Escopo necessário: automations:runs.",
        "x-required-scope": "automations:runs",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AutomationExecution"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/automations/runs/{id}": {
      "get": {
        "tags": [
          "Automações"
        ],
        "summary": "Consultar automações",
        "description": "Escopo necessário: automations:runs.",
        "x-required-scope": "automations:runs",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AutomationExecution"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/automations/{id}/runs": {
      "get": {
        "tags": [
          "Automações"
        ],
        "summary": "Listar automações",
        "description": "Escopo necessário: automations:runs.",
        "x-required-scope": "automations:runs",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AutomationExecution"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/forms/{id}/submissions": {
      "get": {
        "tags": [
          "Formulários"
        ],
        "summary": "Listar formulários",
        "description": "Escopo necessário: form-submissions:read.",
        "x-required-scope": "form-submissions:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FormSubmission"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "formId": "00000000-0000-4000-8000-000000000001",
                        "status": "PROCESSED",
                        "values": {
                          "nome": "Maria Silva"
                        },
                        "contactId": "00000000-0000-4000-8000-000000000001",
                        "dealId": null,
                        "isNewContact": true,
                        "createdAt": "2026-09-30T12:00:00.000Z",
                        "processedAt": "2026-09-30T12:00:00.000Z"
                      }
                    ],
                    "pagination": {
                      "page": 1,
                      "perPage": 20,
                      "total": 1,
                      "totalPages": 1
                    }
                  },
                  "requestId": "00000000-0000-4000-8000-000000000001"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/forms/{id}/submissions/{submissionId}": {
      "get": {
        "tags": [
          "Formulários"
        ],
        "summary": "Consultar formulários",
        "description": "Escopo necessário: form-submissions:read.",
        "x-required-scope": "form-submissions:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "name": "submissionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FormSubmission"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/landing-page-templates": {
      "get": {
        "tags": [
          "Landing pages"
        ],
        "summary": "Listar landing pages",
        "description": "Escopo necessário: landing-pages:read. Lista os modelos incorporados ao editor. Definições completas são retornadas somente por chave em GET /v1/landing-page-templates/{id}.",
        "x-required-scope": "landing-pages:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/LandingPageTemplate"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      },
                      "required": [
                        "items",
                        "pagination"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/landing-page-templates/{id}": {
      "get": {
        "tags": [
          "Landing pages"
        ],
        "summary": "Consultar landing pages",
        "description": "Escopo necessário: landing-pages:read.",
        "x-required-scope": "landing-pages:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Chave do modelo incorporado ao editor, por exemplo projeto-premium.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LandingPageTemplate"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/automations/{id}/activate": {
      "post": {
        "tags": [
          "Automações"
        ],
        "summary": "activate automações",
        "description": "Escopo necessário: automations:publish.",
        "x-required-scope": "automations:publish",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Automation"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "name": "Boas vindas",
                    "status": "active",
                    "triggerType": "form.submitted"
                  },
                  "requestId": "00000000-0000-4000-8000-000000000001"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/automations/{id}/deactivate": {
      "post": {
        "tags": [
          "Automações"
        ],
        "summary": "deactivate automações",
        "description": "Escopo necessário: automations:publish.",
        "x-required-scope": "automations:publish",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Automation"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/forms/{id}/publish": {
      "post": {
        "tags": [
          "Formulários"
        ],
        "summary": "publish formulários",
        "description": "Escopo necessário: forms:publish.",
        "x-required-scope": "forms:publish",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Form"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/forms/{id}/unpublish": {
      "post": {
        "tags": [
          "Formulários"
        ],
        "summary": "unpublish formulários",
        "description": "Escopo necessário: forms:publish.",
        "x-required-scope": "forms:publish",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Form"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/landing-pages/{id}/publish": {
      "post": {
        "tags": [
          "Landing pages"
        ],
        "summary": "publish landing pages",
        "description": "Escopo necessário: landing-pages:publish.",
        "x-required-scope": "landing-pages:publish",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LandingPage"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "name": "Campanha setembro",
                    "slug": "campanha-setembro",
                    "status": "PUBLISHED",
                    "revision": 1,
                    "publishedAt": "2026-09-30T12:00:00.000Z"
                  },
                  "requestId": "00000000-0000-4000-8000-000000000001"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/landing-pages/{id}/unpublish": {
      "post": {
        "tags": [
          "Landing pages"
        ],
        "summary": "unpublish landing pages",
        "description": "Escopo necessário: landing-pages:publish.",
        "x-required-scope": "landing-pages:publish",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Resultado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LandingPage"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/public/forms/{id}/submissions": {
      "post": {
        "tags": [
          "Formulários"
        ],
        "summary": "Enviar formulário publicado",
        "description": "Público, sem Bearer. Limite de 10 envios/minuto por cliente e 300/minuto por formulário. Só aceita campos definidos na versão publicada. Reutiliza criação de contato e evento form.submitted do serviço.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FormSubmissionCreate"
              },
              "example": {
                "values": {
                  "nome": "Maria Silva",
                  "email": "maria@exemplo.com"
                },
                "consent": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Submissão recebida",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        },
                        "submissionId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "message": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "example": {
                  "data": {
                    "ok": true,
                    "submissionId": "00000000-0000-4000-8000-000000000001",
                    "message": "Recebemos seu contato!"
                  },
                  "requestId": "00000000-0000-4000-8000-000000000001"
                }
              }
            }
          },
          "400": {
            "description": "Entrada inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Registro não encontrado nesta empresa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Conexão",
      "description": "Valide a credencial e consulte a empresa vinculada à integração."
    },
    {
      "name": "Contatos",
      "description": "Conecte sua base de leads e clientes. Consulte registros, crie contatos e mantenha seus dados atualizados."
    },
    {
      "name": "Negócios",
      "description": "Integre oportunidades comerciais aos funis da sua empresa. Consulte funis e etapas antes de criar um negócio."
    },
    {
      "name": "Funis e etapas",
      "description": "Descubra os identificadores e as etapas disponíveis para organizar seus negócios."
    },
    {
      "name": "Propostas",
      "description": "POST cria um rascunho. PATCH salva a versão em rascunho e recalcula subtotal, descontos e total no serviço de propostas. DELETE segue a regra de exclusão do domínio e rejeita propostas com contratos."
    },
    {
      "name": "Contratos",
      "description": "Contratos são gerados a partir de uma proposta aprovada; o domínio gera número, texto e valor. PATCH permite apenas as transições send, sign e cancel. Assinaturas digitais em andamento bloqueiam transições manuais. Não há exclusão direta."
    },
    {
      "name": "Agenda",
      "description": "Use ISO 8601 com fuso explícito. PATCH com action=status ou reschedule executa as transições do serviço; sem action, envia todos os campos obrigatórios para substituir o compromisso. DELETE faz soft delete."
    },
    {
      "name": "Projetos",
      "description": "O serviço valida contato, negócio, responsáveis, status e limite do plano. DELETE arquiva o projeto."
    },
    {
      "name": "Catálogo",
      "description": "Preço é Decimal no domínio. PATCH preserva campos omitidos; DELETE arquiva o item."
    },
    {
      "name": "Orçamentos financeiros",
      "description": "Representa o orçamento gerencial anual existente no financeiro, com linhas por mês e categoria. Não é uma cotação comercial. PATCH salva linhas ou muda o status conforme as regras do serviço. DELETE só é permitido quando o orçamento não está vinculado a fechamento da DRE."
    },
    {
      "name": "Faturas",
      "description": "O serviço cria número, itens e parcelas em transação e calcula os totais. PATCH permite somente cancelamento após verificar pagamentos. Para baixa, use o fluxo financeiro do painel; não é possível marcar como paga nesta API. Não há exclusão direta."
    },
    {
      "name": "Equipe"
    },
    {
      "name": "Tarefas"
    },
    {
      "name": "Automações"
    },
    {
      "name": "Formulários"
    },
    {
      "name": "Landing pages"
    }
  ]
}
