{
  "openapi": "3.0.3",
  "info": {
    "title": "Virtuazzachat | CRM para consulta e integração",
    "version": "2.0.0",
    "description": "38 rotas de consulta nas operações Little Duck (7), Eco Flame Garden (11), Sofá na Caixa (12), GrowTech (14) e Afiliados (17).\n\n### Comece pelo cruzamento\n1. Consulte as contas e o catálogo de funis.\n2. Liste as oportunidades do funil; use `meta.has_more` para seguir as páginas.\n3. Relacione `contact_id`, `kanban_funnel_id`, `kanban_stage_id` e `assignee_id` aos respectivos cadastros.\n4. Em `deal.conversations`, `id` é o ID **interno** para os lookups Kanban; `display_id` é o número usado nas rotas de mensagens e conversa.\n5. Consulte tarefas, movimentações, anexos e métricas para completar a análise.\n\n### Autenticação e dados\nEm **Authorize**, informe a chave individual, sem escrever `Bearer`. O acesso ampliado está habilitado para a credencial de Tamura. A chave não é uma senha do painel nem um token nativo do Chatwoot. Cada credencial mantém sua permissão; a referência geral não concede acesso adicional.\n\nRetornos incluem campos personalizados, valores, origem, responsáveis e vínculos quando registrados no CRM. `null` significa ausência de informação. Todos os exemplos desta documentação são fictícios. Campos estruturados de credenciais são removidos. Somente GET é permitido; nenhum endpoint de envio, criação, edição, exclusão ou exportação em lote está liberado.\n\n### Paginação e limites\nOportunidades, tarefas e movimentações começam na **página 0**, com até 50 registros. Contatos, conversas recentes e buscas mantêm páginas **1 a 20**. Histórico do contato e anexos usam cursor. Métricas exigem `since` e `until`, até 366 dias por consulta.\n\nO catálogo de funis consulta ao vivo os IDs cadastrados em 21/10/2026. Funis novos precisam ser incluídos no catálogo ou consultados diretamente por ID; essa estratégia evita a criação automática feita pela listagem nativa em contas vazias.\n\nMCP: https://crm-api.virtuazza.com/mcp. O MCP oferece as mesmas consultas conforme a credencial. [Guia de cruzamento](integration.md) | [Referência geral histórica](reference/).\n"
  },
  "servers": [
    {
      "url": "/crm-readonly",
      "description": "API de leitura autenticada"
    }
  ],
  "security": [
    {
      "readerKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "readerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Cole apenas a chave individual recebida, sem o prefixo Bearer."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Descrição do erro."
          }
        },
        "required": [
          "error"
        ],
        "example": {
          "error": "Conta não autorizada."
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Identificador da operação."
          },
          "name": {
            "type": "string",
            "description": ""
          },
          "status": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "role": {
            "type": "string",
            "description": "",
            "enum": [
              "reader"
            ]
          }
        }
      },
      "Profile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "name": {
            "type": "string",
            "description": ""
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Account"
            }
          }
        }
      },
      "Inbox": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "name": {
            "type": "string",
            "description": ""
          },
          "channel_type": {
            "type": "string",
            "description": ""
          },
          "channel_id": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "business_name": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "phone_number": {
            "type": "string",
            "description": "",
            "nullable": true
          }
        }
      },
      "Inboxes": {
        "type": "object",
        "properties": {
          "payload": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Inbox"
            }
          }
        }
      },
      "Agent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "account_id": {
            "type": "integer",
            "description": ""
          },
          "name": {
            "type": "string",
            "description": ""
          },
          "available_name": {
            "type": "string",
            "description": ""
          },
          "email": {
            "type": "string",
            "description": ""
          },
          "role": {
            "type": "string",
            "description": ""
          },
          "availability_status": {
            "type": "string",
            "description": ""
          },
          "auto_offline": {
            "type": "boolean",
            "description": ""
          },
          "confirmed": {
            "type": "boolean",
            "description": ""
          },
          "thumbnail": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "custom_role_id": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "can_export_deals": {
            "type": "boolean",
            "description": ""
          }
        }
      },
      "Agents": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Agent"
        }
      },
      "Team": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "account_id": {
            "type": "integer",
            "description": ""
          },
          "name": {
            "type": "string",
            "description": ""
          },
          "description": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "allow_auto_assign": {
            "type": "boolean",
            "description": ""
          },
          "icon": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "icon_color": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "is_member": {
            "type": "boolean",
            "description": "Relacionamento do usuário técnico com a equipe; não representa Tamura."
          }
        }
      },
      "Teams": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Team"
        }
      },
      "Label": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "title": {
            "type": "string",
            "description": ""
          },
          "description": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "color": {
            "type": "string",
            "description": ""
          },
          "show_on_sidebar": {
            "type": "boolean",
            "description": ""
          }
        }
      },
      "Labels": {
        "type": "object",
        "properties": {
          "payload": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Label"
            }
          }
        }
      },
      "LabelNames": {
        "type": "object",
        "properties": {
          "payload": {
            "type": "array",
            "items": {
              "type": "string",
              "description": ""
            }
          }
        }
      },
      "AttributeDefinition": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "attribute_display_name": {
            "type": "string",
            "description": ""
          },
          "attribute_key": {
            "type": "string",
            "description": "Chave presente em custom_attributes."
          },
          "attribute_display_type": {
            "type": "string",
            "description": ""
          },
          "attribute_description": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "attribute_model": {
            "type": "string",
            "description": ""
          },
          "attribute_values": {
            "type": "array",
            "items": {
              "type": "string",
              "description": ""
            }
          },
          "regex_pattern": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "regex_cue": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          }
        }
      },
      "AttributeDefinitions": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/AttributeDefinition"
        }
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Use junto com account_id para localizar o contato."
          },
          "name": {
            "type": "string",
            "description": ""
          },
          "email": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "phone_number": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "identifier": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "thumbnail": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "created_at": {
            "type": "integer",
            "description": "Unix timestamp em segundos."
          },
          "last_activity_at": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "additional_attributes": {
            "type": "object",
            "description": "Atributos adicionais, origem e contexto quando registrados.",
            "additionalProperties": true
          },
          "custom_attributes": {
            "type": "object",
            "description": "Campos personalizados do contato.",
            "additionalProperties": true
          },
          "contact_inboxes": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Vínculo entre contato e caixa, quando incluído pela consulta.",
              "additionalProperties": true
            }
          },
          "blocked": {
            "type": "boolean",
            "description": ""
          }
        },
        "example": {
          "id": 1001,
          "name": "Contato de exemplo",
          "email": "contato@example.test",
          "phone_number": null,
          "identifier": "cliente-exemplo",
          "custom_attributes": {
            "segmento": "varejo"
          },
          "additional_attributes": {
            "origem": "formulario"
          }
        }
      },
      "ContactPage": {
        "type": "object",
        "properties": {
          "meta": {
            "type": "object",
            "description": "Contagem e página retornadas pelo CRM.",
            "additionalProperties": true
          },
          "payload": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          }
        }
      },
      "ContactDetail": {
        "type": "object",
        "properties": {
          "payload": {
            "$ref": "#/components/schemas/Contact"
          }
        }
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID da mensagem; serve de cursor before."
          },
          "content": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "content_type": {
            "type": "string",
            "description": ""
          },
          "content_attributes": {
            "type": "object",
            "description": "Metadados do conteúdo.",
            "additionalProperties": true
          },
          "message_type": {
            "type": "integer",
            "description": "0 recebida; 1 enviada; 2 atividade; 3 template."
          },
          "private": {
            "type": "boolean",
            "description": "Nota interna quando true."
          },
          "created_at": {
            "type": "integer",
            "description": "Unix timestamp em segundos."
          },
          "conversation_id": {
            "type": "integer",
            "description": ""
          },
          "account_id": {
            "type": "integer",
            "description": ""
          },
          "inbox_id": {
            "type": "integer",
            "description": ""
          },
          "status": {
            "type": "string",
            "description": ""
          },
          "sender": {
            "type": "object",
            "description": "Contato ou agente remetente.",
            "additionalProperties": true
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attachment"
            }
          }
        }
      },
      "Conversation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Número exibido no CRM (display_id), usado nas rotas conversations."
          },
          "account_id": {
            "type": "integer",
            "description": ""
          },
          "inbox_id": {
            "type": "integer",
            "description": ""
          },
          "uuid": {
            "type": "string",
            "description": ""
          },
          "status": {
            "type": "string",
            "description": "",
            "enum": [
              "open",
              "pending",
              "resolved",
              "snoozed"
            ]
          },
          "priority": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "created_at": {
            "type": "integer",
            "description": "Unix timestamp em segundos."
          },
          "updated_at": {
            "type": "number",
            "description": ""
          },
          "last_activity_at": {
            "type": "integer",
            "description": ""
          },
          "custom_attributes": {
            "type": "object",
            "description": "Campos personalizados da conversa.",
            "additionalProperties": true
          },
          "additional_attributes": {
            "type": "object",
            "description": "Origem e contexto da conversa.",
            "additionalProperties": true
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string",
              "description": ""
            }
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "sender": {
                "$ref": "#/components/schemas/Contact"
              },
              "assignee": {
                "$ref": "#/components/schemas/Agent"
              },
              "team": {
                "$ref": "#/components/schemas/Team"
              },
              "channel": {
                "type": "string",
                "description": ""
              }
            }
          },
          "unread_count": {
            "type": "integer",
            "description": ""
          },
          "can_reply": {
            "type": "boolean",
            "description": ""
          },
          "waiting_since": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "snoozed_until": {
            "type": "number",
            "description": "",
            "nullable": true
          }
        }
      },
      "ConversationPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "meta": {
                "type": "object",
                "description": "Contadores nativos do CRM; mine_count refere-se ao usuário técnico.",
                "additionalProperties": true
              },
              "payload": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          }
        }
      },
      "Messages": {
        "type": "object",
        "properties": {
          "meta": {
            "type": "object",
            "description": "Contexto da conversa e paginação.",
            "additionalProperties": true
          },
          "payload": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          }
        }
      },
      "ContactConversationPage": {
        "type": "object",
        "properties": {
          "payload": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Conversation"
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": "object",
                "properties": {
                  "before_activity_at": {
                    "type": "string",
                    "description": "Copie exatamente o cursor recebido, em microssegundos."
                  },
                  "before_id": {
                    "type": "string",
                    "description": "ID interno, pareado com before_activity_at."
                  }
                },
                "nullable": true
              }
            }
          }
        }
      },
      "SearchResults": {
        "type": "object",
        "properties": {
          "payload": {
            "type": "object",
            "properties": {
              "contacts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Contact"
                }
              },
              "conversations": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Conversation"
                }
              },
              "messages": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          }
        },
        "description": "O conteúdo de payload varia conforme o tipo de busca selecionado."
      },
      "Note": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "content": {
            "type": "string",
            "description": ""
          },
          "user": {
            "$ref": "#/components/schemas/Agent"
          },
          "created_at": {
            "type": "number",
            "description": ""
          },
          "updated_at": {
            "type": "number",
            "description": ""
          }
        }
      },
      "Notes": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Note"
        }
      },
      "Stage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "kanban_funnel_id": {
            "type": "integer",
            "description": ""
          },
          "name": {
            "type": "string",
            "description": ""
          },
          "position": {
            "type": "integer",
            "description": ""
          },
          "color": {
            "type": "string",
            "description": ""
          },
          "team_id": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "commercial_kind": {
            "type": "string",
            "description": "Classificação comercial retornada pela lista de etapas e pelos negócios."
          },
          "clear_tags": {
            "type": "boolean",
            "description": ""
          },
          "questions": {
            "type": "array",
            "items": {
              "type": "string",
              "description": ""
            }
          },
          "created_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          }
        }
      },
      "Stages": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Stage"
        }
      },
      "Funnel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "account_id": {
            "type": "integer",
            "description": ""
          },
          "name": {
            "type": "string",
            "description": ""
          },
          "description": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "active": {
            "type": "boolean",
            "description": ""
          },
          "default_funnel": {
            "type": "boolean",
            "description": ""
          },
          "created_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "kanban_stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Stage"
            }
          }
        }
      },
      "FunnelCatalog": {
        "type": "object",
        "properties": {
          "payload": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Funnel"
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "catalog_updated_at": {
                "type": "string",
                "description": "Data e hora ISO 8601.",
                "format": "date-time"
              },
              "discovery": {
                "type": "string",
                "description": ""
              },
              "note": {
                "type": "string",
                "description": ""
              }
            }
          }
        },
        "description": "Consulta ao vivo dos IDs cadastrados no catálogo. Novos funis precisam entrar no catálogo ou ser consultados diretamente pelo ID. A rota nativa que cria funis vazios nunca é chamada."
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "account_id": {
            "type": "integer",
            "description": ""
          },
          "name": {
            "type": "string",
            "description": ""
          },
          "description": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "min_price": {
            "type": "string",
            "description": "Valor decimal; null significa valor não informado, não zero.",
            "nullable": true
          },
          "max_price": {
            "type": "string",
            "description": "Valor decimal; null significa valor não informado, não zero.",
            "nullable": true
          },
          "active": {
            "type": "boolean",
            "description": ""
          },
          "external_id": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "external_data": {
            "type": "object",
            "description": "Dados externos já gravados no produto do CRM.",
            "additionalProperties": true
          },
          "created_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          }
        }
      },
      "Products": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Product"
        }
      },
      "DealProduct": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "product_id": {
            "type": "integer",
            "description": ""
          },
          "value": {
            "type": "string",
            "description": "Valor decimal; null significa valor não informado, não zero.",
            "nullable": true
          },
          "product": {
            "$ref": "#/components/schemas/Product"
          }
        }
      },
      "LinkedConversation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID INTERNO, usado nos lookups Kanban."
          },
          "display_id": {
            "type": "integer",
            "description": "Número exibido, usado em conversations/{conversation_number}."
          },
          "status": {
            "type": "string",
            "description": ""
          },
          "created_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "last_activity_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "inbox": {
            "$ref": "#/components/schemas/Inbox"
          }
        }
      },
      "NextReturn": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "description": "",
            "enum": [
              "tasks"
            ]
          },
          "task": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": ""
              },
              "title": {
                "type": "string",
                "description": ""
              },
              "due_at": {
                "type": "string",
                "description": "Data e hora ISO 8601.",
                "nullable": true,
                "format": "date-time"
              },
              "lock_version": {
                "type": "integer",
                "description": ""
              },
              "assignee": {
                "$ref": "#/components/schemas/Agent"
              }
            },
            "nullable": true
          }
        },
        "nullable": true,
        "description": "Próxima tarefa pendente. task=null quando não há pendência; não reativa a data legada."
      },
      "Deal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "account_id": {
            "type": "integer",
            "description": ""
          },
          "contact_id": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "kanban_funnel_id": {
            "type": "integer",
            "description": ""
          },
          "kanban_stage_id": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "assignee_id": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "deal_value": {
            "type": "string",
            "description": "Valor decimal; null significa valor não informado, não zero.",
            "nullable": true
          },
          "product_name": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "expected_close_date": {
            "type": "string",
            "description": "",
            "nullable": true,
            "format": "date"
          },
          "lead_source": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "loss_reason": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "custom_fields": {
            "type": "object",
            "description": "Campos do negócio, UTMs, próxima ação e metadados já registrados.",
            "additionalProperties": true
          },
          "created_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "lock_version": {
            "type": "integer",
            "description": ""
          },
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "assignee": {
            "$ref": "#/components/schemas/Agent"
          },
          "kanban_stage": {
            "$ref": "#/components/schemas/Stage"
          },
          "kanban_funnel": {
            "$ref": "#/components/schemas/Funnel"
          },
          "deal_products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DealProduct"
            }
          },
          "conversations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkedConversation"
            }
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": ""
                }
              }
            }
          },
          "next_return": {
            "$ref": "#/components/schemas/NextReturn"
          },
          "linked_to_conversation": {
            "type": "boolean",
            "description": ""
          }
        },
        "example": {
          "id": 2001,
          "account_id": 12,
          "contact_id": 1001,
          "kanban_funnel_id": 101,
          "kanban_stage_id": 102,
          "title": "Oportunidade de exemplo",
          "deal_value": "2500.00",
          "product_name": "Produto de exemplo",
          "lead_source": "campanha",
          "custom_fields": {
            "utm_campaign": "campanha-exemplo",
            "next_action": "Retornar contato"
          },
          "labels": [
            {
              "name": "exemplo"
            }
          ],
          "contact": {
            "id": 1001,
            "name": "Contato de exemplo",
            "email": "contato@example.test",
            "phone_number": null,
            "identifier": "cliente-exemplo",
            "custom_attributes": {
              "segmento": "varejo"
            },
            "additional_attributes": {
              "origem": "formulario"
            }
          },
          "kanban_stage": {
            "id": 102,
            "name": "Em negociação",
            "commercial_kind": "open"
          },
          "conversations": [
            {
              "id": 3001,
              "display_id": 901,
              "status": "open",
              "inbox": {
                "id": 201,
                "name": "Caixa de exemplo"
              }
            }
          ],
          "deal_products": [
            {
              "id": 501,
              "product_id": 401,
              "value": "2500.00",
              "product": {
                "id": 401,
                "name": "Produto de exemplo"
              }
            }
          ]
        }
      },
      "Deals": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Deal"
        }
      },
      "DealPage": {
        "type": "object",
        "properties": {
          "deals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Deal"
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "total_count": {
                "type": "integer",
                "description": ""
              },
              "page": {
                "type": "integer",
                "description": "Página iniciada em zero."
              },
              "has_more": {
                "type": "boolean",
                "description": ""
              },
              "stages": {
                "type": "object",
                "description": "Mapa por ID da etapa, com count, value e value_count.",
                "additionalProperties": true
              },
              "stage_counts": {
                "type": "object",
                "description": "Contagem nativa por etapa, antes do filtro da consulta.",
                "additionalProperties": true
              }
            }
          }
        },
        "example": {
          "deals": [
            {
              "id": 2001,
              "account_id": 12,
              "contact_id": 1001,
              "kanban_funnel_id": 101,
              "kanban_stage_id": 102,
              "title": "Oportunidade de exemplo",
              "deal_value": "2500.00",
              "product_name": "Produto de exemplo",
              "lead_source": "campanha",
              "custom_fields": {
                "utm_campaign": "campanha-exemplo",
                "next_action": "Retornar contato"
              },
              "labels": [
                {
                  "name": "exemplo"
                }
              ],
              "contact": {
                "id": 1001,
                "name": "Contato de exemplo",
                "email": "contato@example.test",
                "phone_number": null,
                "identifier": "cliente-exemplo",
                "custom_attributes": {
                  "segmento": "varejo"
                },
                "additional_attributes": {
                  "origem": "formulario"
                }
              },
              "kanban_stage": {
                "id": 102,
                "name": "Em negociação",
                "commercial_kind": "open"
              },
              "conversations": [
                {
                  "id": 3001,
                  "display_id": 901,
                  "status": "open",
                  "inbox": {
                    "id": 201,
                    "name": "Caixa de exemplo"
                  }
                }
              ],
              "deal_products": [
                {
                  "id": 501,
                  "product_id": 401,
                  "value": "2500.00",
                  "product": {
                    "id": 401,
                    "name": "Produto de exemplo"
                  }
                }
              ]
            }
          ],
          "meta": {
            "total_count": 1,
            "page": 0,
            "has_more": false,
            "stages": {},
            "stage_counts": {}
          }
        }
      },
      "Task": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "account_id": {
            "type": "integer",
            "description": ""
          },
          "deal_id": {
            "type": "integer",
            "description": ""
          },
          "title": {
            "type": "string",
            "description": ""
          },
          "description": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "due_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "nullable": true,
            "format": "date-time"
          },
          "completed_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "nullable": true,
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "lock_version": {
            "type": "integer",
            "description": ""
          },
          "assignee": {
            "$ref": "#/components/schemas/Agent"
          },
          "completed_by": {
            "$ref": "#/components/schemas/Agent"
          },
          "deal": {
            "$ref": "#/components/schemas/Deal"
          }
        },
        "example": {
          "id": 6001,
          "account_id": 12,
          "deal_id": 2001,
          "title": "Retornar contato",
          "due_at": "2026-10-22T13:00:00Z",
          "completed_at": null,
          "assignee": {
            "id": 701,
            "name": "Responsável de exemplo"
          }
        }
      },
      "TaskPage": {
        "type": "object",
        "properties": {
          "tasks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Task"
            }
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          }
        },
        "example": {
          "tasks": [
            {
              "id": 6001,
              "account_id": 12,
              "deal_id": 2001,
              "title": "Retornar contato",
              "due_at": "2026-10-22T13:00:00Z",
              "completed_at": null,
              "assignee": {
                "id": 701,
                "name": "Responsável de exemplo"
              }
            }
          ],
          "has_more": false
        }
      },
      "Movement": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "deal_id": {
            "type": "integer",
            "description": ""
          },
          "from_stage_id": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "to_stage_id": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "from_stage_name": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "to_stage_name": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "occurred_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "source": {
            "type": "string",
            "description": ""
          },
          "actor_id": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "actor": {
            "$ref": "#/components/schemas/Agent"
          }
        }
      },
      "PaymentReceipt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "store": {
            "type": "string",
            "description": ""
          },
          "order_id": {
            "type": "string",
            "description": ""
          },
          "amount": {
            "type": "string",
            "description": "Valor decimal; null significa valor não informado, não zero.",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "description": ""
          },
          "paid_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "source_user": {
            "$ref": "#/components/schemas/Agent"
          }
        },
        "description": "Recibo já vinculado à oportunidade, conforme registrado pelo CRM; não é uma consulta direta ao financeiro ou à loja."
      },
      "MovementPage": {
        "type": "object",
        "properties": {
          "movements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Movement"
            }
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentReceipt"
            }
          }
        }
      },
      "Attachment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "message_id": {
            "type": "integer",
            "description": ""
          },
          "file_type": {
            "type": "string",
            "description": ""
          },
          "extension": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "file_size": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "width": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "height": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "file_name": {
            "type": "string",
            "description": ""
          },
          "data_url": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "thumb_url": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "unavailable": {
            "type": "boolean",
            "description": ""
          },
          "created_at": {
            "type": "integer",
            "description": "Unix timestamp em segundos."
          },
          "conversation_id": {
            "type": "integer",
            "description": "Número exibido da conversa."
          },
          "inbox_name": {
            "type": "string",
            "description": ""
          }
        }
      },
      "AttachmentPage": {
        "type": "object",
        "properties": {
          "payload": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attachment"
            }
          },
          "next_before_id": {
            "type": "integer",
            "description": "",
            "nullable": true
          }
        }
      },
      "FunnelLink": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": ""
          },
          "conversation_id": {
            "type": "integer",
            "description": "ID interno."
          },
          "kanban_funnel_id": {
            "type": "integer",
            "description": ""
          },
          "kanban_stage_id": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "custom_fields": {
            "type": "object",
            "description": "Campos do vínculo Kanban legado.",
            "additionalProperties": true
          },
          "kanban_funnel": {
            "$ref": "#/components/schemas/Funnel"
          },
          "kanban_stage": {
            "$ref": "#/components/schemas/Stage"
          }
        }
      },
      "FunnelLinks": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/FunnelLink"
        }
      },
      "DealStatistics": {
        "type": "object",
        "properties": {
          "as_of": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "description": "Data e hora ISO 8601.",
            "nullable": true,
            "format": "date-time"
          },
          "age_seconds": {
            "type": "integer",
            "description": "",
            "nullable": true
          },
          "stage_entry": {
            "type": "object",
            "properties": {
              "recorded": {
                "type": "boolean",
                "description": ""
              },
              "entered_at": {
                "type": "string",
                "description": "Data e hora ISO 8601.",
                "nullable": true,
                "format": "date-time"
              },
              "elapsed_seconds": {
                "type": "integer",
                "description": "",
                "nullable": true
              }
            }
          },
          "source": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "tracking": {
            "type": "object",
            "description": "UTMs, gclid, fbclid e origem quando registrados.",
            "additionalProperties": true
          },
          "tasks": {
            "type": "object",
            "properties": {
              "pending": {
                "type": "integer",
                "description": ""
              },
              "overdue": {
                "type": "integer",
                "description": ""
              },
              "completed": {
                "type": "integer",
                "description": ""
              },
              "without_due_date": {
                "type": "integer",
                "description": ""
              }
            }
          },
          "activity": {
            "type": "object",
            "properties": {
              "conversations": {
                "type": "integer",
                "description": ""
              },
              "incoming_messages": {
                "type": "integer",
                "description": ""
              },
              "outgoing_messages": {
                "type": "integer",
                "description": ""
              },
              "failed_outgoing": {
                "type": "integer",
                "description": ""
              },
              "internal_notes": {
                "type": "integer",
                "description": ""
              },
              "email_messages": {
                "type": "integer",
                "description": ""
              },
              "by_status": {
                "type": "object",
                "description": "Contadores por status.",
                "additionalProperties": true
              },
              "calls": {
                "type": "object",
                "properties": {
                  "incoming": {
                    "type": "integer",
                    "description": ""
                  },
                  "outgoing": {
                    "type": "integer",
                    "description": ""
                  }
                },
                "nullable": true
              }
            }
          }
        }
      },
      "MetricsSummary": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "description": ""
          },
          "active_count": {
            "type": "integer",
            "description": ""
          },
          "won_count": {
            "type": "integer",
            "description": ""
          },
          "lost_count": {
            "type": "integer",
            "description": ""
          },
          "stale_count": {
            "type": "integer",
            "description": ""
          },
          "bottleneck_count": {
            "type": "integer",
            "description": ""
          },
          "active_value": {
            "type": "number",
            "description": ""
          },
          "won_value": {
            "type": "number",
            "description": ""
          },
          "lost_value": {
            "type": "number",
            "description": ""
          },
          "conversion_rate": {
            "type": "number",
            "description": ""
          },
          "avg_deal_value": {
            "type": "number",
            "description": ""
          },
          "stale_value": {
            "type": "number",
            "description": ""
          },
          "avg_cycle_days": {
            "type": "number",
            "description": ""
          },
          "bottleneck_stage": {
            "type": "string",
            "description": "",
            "nullable": true
          }
        }
      },
      "StageMetric": {
        "type": "object",
        "properties": {
          "stage_id": {
            "type": "integer",
            "description": ""
          },
          "stage_name": {
            "type": "string",
            "description": ""
          },
          "stage_color": {
            "type": "string",
            "description": ""
          },
          "count": {
            "type": "integer",
            "description": ""
          },
          "value": {
            "type": "number",
            "description": ""
          },
          "avg_days_in_stage": {
            "type": "number",
            "description": "",
            "nullable": true
          },
          "stage_time_known_count": {
            "type": "integer",
            "description": ""
          },
          "stage_time_unknown_count": {
            "type": "integer",
            "description": ""
          }
        }
      },
      "StageMetrics": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/StageMetric"
        }
      },
      "PeriodMetrics": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string",
              "description": "Dia/semana YYYY-MM-DD ou mês YYYY-MM."
            },
            "count": {
              "type": "integer",
              "description": ""
            }
          }
        }
      }
    }
  },
  "paths": {
    "/api/v1/profile": {
      "get": {
        "operationId": "crm_accounts",
        "summary": "Contas autorizadas",
        "tags": [
          "Contas e caixas"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/inboxes": {
      "get": {
        "operationId": "crm_inboxes",
        "summary": "Caixas de entrada",
        "tags": [
          "Contas e caixas"
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                7,
                11,
                12,
                14,
                17
              ]
            },
            "description": "7 Little Duck; 11 Eco Flame Garden; 12 Sofá na Caixa; 14 GrowTech; 17 Afiliados."
          },
          {
            "name": "compact",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ],
              "default": "true"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inboxes"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/contacts": {
      "get": {
        "operationId": "crm_recent_contacts",
        "summary": "Contatos recentes, inclusive sem conversa",
        "tags": [
          "Contatos"
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                7,
                11,
                12,
                14,
                17
              ]
            },
            "description": "7 Little Duck; 11 Eco Flame Garden; 12 Sofá na Caixa; 14 GrowTech; 17 Afiliados."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 1
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "-created_at"
              ],
              "default": "-created_at"
            }
          },
          {
            "name": "include_contact_inboxes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "false"
              ],
              "default": "false"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPage"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/conversations": {
      "get": {
        "operationId": "crm_recent_conversations",
        "summary": "Conversas recentes",
        "tags": [
          "Conversas e mensagens"
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                7,
                11,
                12,
                14,
                17
              ]
            },
            "description": "7 Little Duck; 11 Eco Flame Garden; 12 Sofá na Caixa; 14 GrowTech; 17 Afiliados."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "open",
                "pending",
                "resolved",
                "snoozed"
              ],
              "default": "all"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at_desc"
              ],
              "default": "created_at_desc"
            }
          },
          {
            "name": "inbox_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationPage"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/search/{type}": {
      "get": {
        "operationId": "crm_search",
        "summary": "Buscar contatos, conversas ou mensagens",
        "tags": [
          "Busca"
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                7,
                11,
                12,
                14,
                17
              ]
            },
            "description": "7 Little Duck; 11 Eco Flame Garden; 12 Sofá na Caixa; 14 GrowTech; 17 Afiliados."
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "contacts",
                "conversations",
                "messages"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 160
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResults"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/contacts/{contact_id}": {
      "get": {
        "operationId": "crm_contact",
        "summary": "Dados de um contato",
        "tags": [
          "Contatos"
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                7,
                11,
                12,
                14,
                17
              ]
            },
            "description": "7 Little Duck; 11 Eco Flame Garden; 12 Sofá na Caixa; 14 GrowTech; 17 Afiliados."
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactDetail"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/conversations/{conversation_number}": {
      "get": {
        "operationId": "crm_conversation",
        "summary": "Dados de uma conversa",
        "tags": [
          "Conversas e mensagens"
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                7,
                11,
                12,
                14,
                17
              ]
            },
            "description": "7 Little Duck; 11 Eco Flame Garden; 12 Sofá na Caixa; 14 GrowTech; 17 Afiliados."
          },
          {
            "name": "conversation_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Número exibido no CRM, display_id, não o ID global do banco."
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/conversations/{conversation_number}/messages": {
      "get": {
        "operationId": "crm_messages",
        "summary": "Mensagens de uma conversa",
        "tags": [
          "Conversas e mensagens"
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                7,
                11,
                12,
                14,
                17
              ]
            },
            "description": "7 Little Duck; 11 Eco Flame Garden; 12 Sofá na Caixa; 14 GrowTech; 17 Afiliados."
          },
          {
            "name": "conversation_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Número exibido no CRM."
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "ID de mensagem para buscar mensagens anteriores."
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Messages"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/funnels": {
      "get": {
        "operationId": "crm_funnels",
        "tags": [
          "Funis"
        ],
        "summary": "Listar funis cadastrados para consulta",
        "description": "Ferramenta MCP: `crm_funnels`. Retorna os dados existentes na operação informada, sem alterá-los. O catálogo usa IDs registrados; cada funil é consultado ao vivo por ID. Nunca chama a listagem nativa que pode criar um funil.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "description": "Listar funis cadastrados para consulta",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FunnelCatalog"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/funnels/{funnel_id}": {
      "get": {
        "operationId": "crm_funnel",
        "tags": [
          "Funis"
        ],
        "summary": "Consultar um funil e suas etapas",
        "description": "Ferramenta MCP: `crm_funnel`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "funnel_id",
            "in": "path",
            "required": true,
            "description": "ID do funil, obtido no catálogo ou nos vínculos da oportunidade.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Funnel"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/funnels/{funnel_id}/stages": {
      "get": {
        "operationId": "crm_stages",
        "tags": [
          "Funis"
        ],
        "summary": "Listar etapas e classificação comercial",
        "description": "Ferramenta MCP: `crm_stages`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "funnel_id",
            "in": "path",
            "required": true,
            "description": "ID do funil, obtido no catálogo ou nos vínculos da oportunidade.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Stages"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/funnels/{funnel_id}/deals": {
      "get": {
        "operationId": "crm_deals",
        "tags": [
          "Oportunidades"
        ],
        "summary": "Listar e filtrar oportunidades, 50 por página",
        "description": "Ferramenta MCP: `crm_deals`. Retorna os dados existentes na operação informada, sem alterá-los. A resposta inclui produtos, contato, etapa, etiquetas, próxima tarefa e conversas vinculadas. `deal_value=null` não significa zero.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "funnel_id",
            "in": "path",
            "required": true,
            "description": "ID do funil, obtido no catálogo ou nos vínculos da oportunidade.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "description": "Formato da consulta. Oportunidades usam obrigatoriamente list para garantir paginação.",
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ],
              "default": "list"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Página iniciada em zero; até 50 registros. Continue enquanto has_more for true.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9999999,
              "default": 0
            }
          },
          {
            "name": "stage_id",
            "in": "query",
            "required": false,
            "description": "Listar e filtrar oportunidades, 50 por página",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "assignee_id",
            "in": "query",
            "required": false,
            "description": "ID de responsável da própria conta, ou unassigned. mine não é aceito porque a integração usa um usuário técnico.",
            "schema": {
              "type": "string",
              "pattern": "^(unassigned|[1-9][0-9]{0,9})$"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Listar e filtrar oportunidades, 50 por página",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "active",
                "won",
                "lost"
              ],
              "default": "all"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Busca no título/produto da oportunidade e no nome, e-mail ou telefone do contato.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "next_action",
            "in": "query",
            "required": false,
            "description": "Listar e filtrar oportunidades, 50 por página",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "overdue",
                "today",
                "upcoming",
                "none"
              ],
              "default": "all"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "Fuso IANA usado para hoje, atrasos e próximas ações.",
            "schema": {
              "type": "string",
              "maxLength": 64,
              "default": "America/Sao_Paulo"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealPage"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/funnels/{funnel_id}/deals/{deal_id}": {
      "get": {
        "operationId": "crm_deal",
        "tags": [
          "Oportunidades"
        ],
        "summary": "Ler oportunidade com contato, responsável, produtos e conversas",
        "description": "Ferramenta MCP: `crm_deal`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "funnel_id",
            "in": "path",
            "required": true,
            "description": "ID do funil, obtido no catálogo ou nos vínculos da oportunidade.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "description": "ID da oportunidade, pertencente ao funil e à conta informados.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deal"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/funnels/{funnel_id}/deals/{deal_id}/stage_movements": {
      "get": {
        "operationId": "crm_deal_movements",
        "tags": [
          "Oportunidades"
        ],
        "summary": "Histórico de etapas e recebimentos vinculados",
        "description": "Ferramenta MCP: `crm_deal_movements`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "funnel_id",
            "in": "path",
            "required": true,
            "description": "ID do funil, obtido no catálogo ou nos vínculos da oportunidade.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "description": "ID da oportunidade, pertencente ao funil e à conta informados.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Página iniciada em zero; até 50 registros. Continue enquanto has_more for true.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9999999,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MovementPage"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/funnels/{funnel_id}/deals/{deal_id}/statistics": {
      "get": {
        "operationId": "crm_deal_statistics",
        "tags": [
          "Oportunidades"
        ],
        "summary": "Atividade, origem, UTMs e indicadores da oportunidade",
        "description": "Ferramenta MCP: `crm_deal_statistics`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "funnel_id",
            "in": "path",
            "required": true,
            "description": "ID do funil, obtido no catálogo ou nos vínculos da oportunidade.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "description": "ID da oportunidade, pertencente ao funil e à conta informados.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealStatistics"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/funnels/{funnel_id}/deals/{deal_id}/attachments": {
      "get": {
        "operationId": "crm_deal_attachments",
        "tags": [
          "Oportunidades"
        ],
        "summary": "Anexos das conversas vinculadas, com cursor",
        "description": "Ferramenta MCP: `crm_deal_attachments`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "funnel_id",
            "in": "path",
            "required": true,
            "description": "ID do funil, obtido no catálogo ou nos vínculos da oportunidade.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "description": "ID da oportunidade, pertencente ao funil e à conta informados.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "before_id",
            "in": "query",
            "required": false,
            "description": "Cursor retornado na página anterior. No histórico do contato, use junto com before_activity_at.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentPage"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/deals/by_contact/{contact_id}": {
      "get": {
        "operationId": "crm_contact_deals",
        "tags": [
          "Vínculos"
        ],
        "summary": "Oportunidades de um contato",
        "description": "Ferramenta MCP: `crm_contact_deals`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "ID do contato nesta operação.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "conversation_display_id",
            "in": "query",
            "required": false,
            "description": "Oportunidades de um contato",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deals"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/deals/by_conversation/{conversation_id}": {
      "get": {
        "operationId": "crm_conversation_deals",
        "tags": [
          "Vínculos"
        ],
        "summary": "Oportunidades pelo ID interno da conversa",
        "description": "Ferramenta MCP: `crm_conversation_deals`. Retorna os dados existentes na operação informada, sem alterá-los. Exige ID INTERNO; use `id` da conversa no retorno da oportunidade.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "description": "ID INTERNO da conversa, obtido em deal.conversations[].id. Não use display_id.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deals"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/conversations/{conversation_id}/lookup": {
      "get": {
        "operationId": "crm_conversation_funnels",
        "tags": [
          "Vínculos"
        ],
        "summary": "Vínculos Kanban pelo ID interno da conversa",
        "description": "Ferramenta MCP: `crm_conversation_funnels`. Retorna os dados existentes na operação informada, sem alterá-los. Exige ID INTERNO; use `id` da conversa no retorno da oportunidade.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "description": "ID INTERNO da conversa, obtido em deal.conversations[].id. Não use display_id.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FunnelLinks"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/products": {
      "get": {
        "operationId": "crm_products",
        "tags": [
          "Produtos"
        ],
        "summary": "Catálogo de produtos ativos do CRM",
        "description": "Ferramenta MCP: `crm_products`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Products"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/products/{product_id}": {
      "get": {
        "operationId": "crm_product",
        "tags": [
          "Produtos"
        ],
        "summary": "Dados e faixa de preço de um produto",
        "description": "Ferramenta MCP: `crm_product`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "description": "ID do produto do CRM.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/tasks": {
      "get": {
        "operationId": "crm_tasks",
        "tags": [
          "Tarefas"
        ],
        "summary": "Tarefas, retornos e pendências, 50 por página",
        "description": "Ferramenta MCP: `crm_tasks`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "deal_id",
            "in": "query",
            "required": false,
            "description": "ID da oportunidade, pertencente ao funil e à conta informados.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "description": "Formato da consulta. Oportunidades usam obrigatoriamente list para garantir paginação.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "completed",
                "overdue",
                "unassigned",
                "today"
              ],
              "default": "pending"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Página iniciada em zero; até 50 registros. Continue enquanto has_more for true.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9999999,
              "default": 0
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "Fuso IANA usado para hoje, atrasos e próximas ações.",
            "schema": {
              "type": "string",
              "maxLength": 64,
              "default": "America/Sao_Paulo"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskPage"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/tasks/{task_id}": {
      "get": {
        "operationId": "crm_task",
        "tags": [
          "Tarefas"
        ],
        "summary": "Detalhes de uma tarefa e da oportunidade",
        "description": "Ferramenta MCP: `crm_task`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "description": "ID da tarefa.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/deal_metrics/summary": {
      "get": {
        "operationId": "crm_metrics_summary",
        "tags": [
          "Métricas"
        ],
        "summary": "Conversão, valores e gargalos no período",
        "description": "Ferramenta MCP: `crm_metrics_summary`. Retorna os dados existentes na operação informada, sem alterá-los. Filtro por data de criação das oportunidades, inclusive nas pontas; não equivale à data de recebimento de vendas.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "funnel_id",
            "in": "query",
            "required": false,
            "description": "ID do funil, obtido no catálogo ou nos vínculos da oportunidade.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": true,
            "description": "Primeiro dia do período, YYYY-MM-DD.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": true,
            "description": "Último dia, inclusivo, YYYY-MM-DD. Até 366 dias por consulta.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetricsSummary"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/deal_metrics/by_stage": {
      "get": {
        "operationId": "crm_metrics_stages",
        "tags": [
          "Métricas"
        ],
        "summary": "Volume, valor e permanência por etapa",
        "description": "Ferramenta MCP: `crm_metrics_stages`. Retorna os dados existentes na operação informada, sem alterá-los. Filtro por data de criação das oportunidades, inclusive nas pontas; não equivale à data de recebimento de vendas.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "funnel_id",
            "in": "query",
            "required": false,
            "description": "ID do funil, obtido no catálogo ou nos vínculos da oportunidade.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": true,
            "description": "Primeiro dia do período, YYYY-MM-DD.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": true,
            "description": "Último dia, inclusivo, YYYY-MM-DD. Até 366 dias por consulta.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StageMetrics"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/kanban/deal_metrics/by_period": {
      "get": {
        "operationId": "crm_metrics_period",
        "tags": [
          "Métricas"
        ],
        "summary": "Oportunidades criadas por dia, semana ou mês",
        "description": "Ferramenta MCP: `crm_metrics_period`. Retorna os dados existentes na operação informada, sem alterá-los. Filtro por data de criação das oportunidades, inclusive nas pontas; não equivale à data de recebimento de vendas.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "funnel_id",
            "in": "query",
            "required": false,
            "description": "ID do funil, obtido no catálogo ou nos vínculos da oportunidade.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": true,
            "description": "Primeiro dia do período, YYYY-MM-DD.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": true,
            "description": "Último dia, inclusivo, YYYY-MM-DD. Até 366 dias por consulta.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "description": "Oportunidades criadas por dia, semana ou mês",
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ],
              "default": "day"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PeriodMetrics"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/contacts/{contact_id}/conversations": {
      "get": {
        "operationId": "crm_contact_conversations",
        "tags": [
          "Vínculos"
        ],
        "summary": "Histórico de conversas do contato, 20 por página",
        "description": "Ferramenta MCP: `crm_contact_conversations`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "ID do contato nesta operação.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "before_activity_at",
            "in": "query",
            "required": false,
            "description": "Cursor em microssegundos, copiado de meta.next_cursor; precisa de before_id.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9999999999999999999
            }
          },
          {
            "name": "before_id",
            "in": "query",
            "required": false,
            "description": "Cursor retornado na página anterior. No histórico do contato, use junto com before_activity_at.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactConversationPage"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/contacts/{contact_id}/labels": {
      "get": {
        "operationId": "crm_contact_labels",
        "tags": [
          "Etiquetas"
        ],
        "summary": "Etiquetas do contato",
        "description": "Ferramenta MCP: `crm_contact_labels`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "ID do contato nesta operação.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelNames"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/contacts/{contact_id}/notes": {
      "get": {
        "operationId": "crm_contact_notes",
        "tags": [
          "Contatos"
        ],
        "summary": "Notas internas do contato",
        "description": "Ferramenta MCP: `crm_contact_notes`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "ID do contato nesta operação.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notes"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/contacts/{contact_id}/notes/{note_id}": {
      "get": {
        "operationId": "crm_contact_note",
        "tags": [
          "Contatos"
        ],
        "summary": "Ler uma nota interna do contato",
        "description": "Ferramenta MCP: `crm_contact_note`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "description": "ID do contato nesta operação.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          },
          {
            "name": "note_id",
            "in": "path",
            "required": true,
            "description": "ID da nota do contato.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/conversations/{conversation_number}/labels": {
      "get": {
        "operationId": "crm_conversation_labels",
        "tags": [
          "Etiquetas"
        ],
        "summary": "Etiquetas da conversa pelo número exibido",
        "description": "Ferramenta MCP: `crm_conversation_labels`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "conversation_number",
            "in": "path",
            "required": true,
            "description": "Número exibido no CRM (display_id).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelNames"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/agents": {
      "get": {
        "operationId": "crm_agents",
        "tags": [
          "Equipe"
        ],
        "summary": "Responsáveis e agentes das operações autorizadas",
        "description": "Ferramenta MCP: `crm_agents`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agents"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/teams": {
      "get": {
        "operationId": "crm_teams",
        "tags": [
          "Equipe"
        ],
        "summary": "Equipes da operação",
        "description": "Ferramenta MCP: `crm_teams`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Teams"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/teams/{team_id}": {
      "get": {
        "operationId": "crm_team",
        "tags": [
          "Equipe"
        ],
        "summary": "Dados de uma equipe",
        "description": "Ferramenta MCP: `crm_team`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "description": "ID da equipe.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Team"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/teams/{team_id}/team_members": {
      "get": {
        "operationId": "crm_team_members",
        "tags": [
          "Equipe"
        ],
        "summary": "Agentes vinculados a uma equipe",
        "description": "Ferramenta MCP: `crm_team_members`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "description": "ID da equipe.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agents"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/labels": {
      "get": {
        "operationId": "crm_labels",
        "tags": [
          "Etiquetas"
        ],
        "summary": "Catálogo de etiquetas da operação",
        "description": "Ferramenta MCP: `crm_labels`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Labels"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/custom_attribute_definitions": {
      "get": {
        "operationId": "crm_custom_attributes",
        "tags": [
          "Campos personalizados"
        ],
        "summary": "Definições de campos de contato ou conversa",
        "description": "Ferramenta MCP: `crm_custom_attributes`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "attribute_model",
            "in": "query",
            "required": false,
            "description": "Tipo do cadastro: contato ou conversa.",
            "schema": {
              "type": "string",
              "enum": [
                "contact_attribute",
                "conversation_attribute"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttributeDefinitions"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{account_id}/custom_attribute_definitions/{attribute_id}": {
      "get": {
        "operationId": "crm_custom_attribute",
        "tags": [
          "Campos personalizados"
        ],
        "summary": "Tipo, descrição e valores de um campo",
        "description": "Ferramenta MCP: `crm_custom_attribute`. Retorna os dados existentes na operação informada, sem alterá-los.",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "description": "Operação autorizada.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647,
              "enum": [
                7,
                11,
                12,
                14,
                17
              ],
              "default": 12
            }
          },
          {
            "name": "attribute_id",
            "in": "path",
            "required": true,
            "description": "ID da definição do campo.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2147483647
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. Campos disponíveis dependem dos dados registrados no CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttributeDefinition"
                }
              }
            }
          },
          "400": {
            "description": "Consulta inválida: verifique parâmetros, cursor e período.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Chave ausente ou inválida.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Conta ou objeto fora do acesso autorizado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registro, rota ou capacidade indisponível para esta chave.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Escrita bloqueada. Somente GET é permitido na API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de consultas do CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Falha ao consultar o CRM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Contas e caixas"
    },
    {
      "name": "Funis"
    },
    {
      "name": "Oportunidades"
    },
    {
      "name": "Produtos"
    },
    {
      "name": "Tarefas"
    },
    {
      "name": "Métricas"
    },
    {
      "name": "Vínculos"
    },
    {
      "name": "Contatos"
    },
    {
      "name": "Conversas e mensagens"
    },
    {
      "name": "Busca"
    },
    {
      "name": "Equipe"
    },
    {
      "name": "Etiquetas"
    },
    {
      "name": "Campos personalizados"
    }
  ],
  "x-source-revision": "af9dae409c623221525b56fc1f6abadfb73d3b68",
  "x-read-only-tools": 38
}
